18,490 Topics

Member Avatar for
Member Avatar for harikrishna439

int a[3]={1,2,3}; printf("%d",a[3]); While I'm executing this snippet, I'm getting the output as 2. Is 2 a garbage value here? I don't think so... Can anyone explain how 2 comes instead of a garbage value? Any answer could be appreaciated.

Member Avatar for arindam31
0
179
Member Avatar for asrockw7

So I got curious with OpenGL and I ended up having a copy of the "redbook", as people call it. Initially when I tried relying only on online sources like tutorials and whatnot they were all written using WinMain which was a drag so that sort of put me away …

Member Avatar for Sodabread
0
696
Member Avatar for DOT6

Hello, I am creating a card game and need some advice/pointers or code snipets if possible on sprite movement in the sence I need to create an action of a card been drawn from the deck. Basicly I need to make the sprite(card) move from the deck posion(x,y) to the …

Member Avatar for DOT6
0
330
Member Avatar for D33wakar

I'm trying to convert hexadecimal values to Binary. I've done Decimal values to Binary up to 32 bits in this way: [CODE] #include <stdio.h> int showbits(int);/**************function*prototype******************************/ int main() { unsigned int num; printf("enter the number."); scanf("%d",&num); printf("%d in binary is ",num); printf("\n"); showbits(num);/*********************function*call********************************/ return 0; } showbits (int n)/******************function*definition****************************/ //* …

Member Avatar for D33wakar
0
427
Member Avatar for syria718

[CODE]char main()/*Start of the function main???*/ { char choice1; char choices = 'y'; while(choices == 'y' && choices != 'n'){/*while loop initialization*/ print(); getchar(); scanf("%c",&choice1); printf("%c",choice1); switch(choice1){/*Switch case statement,,,*/ case 'a': case 'A': addContact(); break; case 'f': case 'F': search(contacts); break; case 'v': case 'V': list(); break; case 'e': case …

Member Avatar for Narue
0
301
Member Avatar for Chamath
Member Avatar for Chamath
0
171
Member Avatar for Daniel_Wright

Hey! I have a problem. I've been coding Python for two years now, and it's great, but now I'd like to use a module called "ctypes" to import C function into Python. I know how to do it and all, but the problem is: I know how to program in …

Member Avatar for Daniel_Wright
0
331
Member Avatar for cemali_ys

Hello! I am writing a program to execute another process. But the argment string has " ) ( ; / \ symbols. So it does not allow me to start the program with the true string (argument)... Here is the program: the program is on the user agent string: [CODE]#include …

Member Avatar for cemali_ys
0
163
Member Avatar for Pro2000

Hello everybody.. I've been wondering whether the C language can copy files from the internet into the user's device, and whether it can process web pages and databases or not.. I think that ASP can do this. However, what should I do if my server's operating system is Linux?? Is …

Member Avatar for Pro2000
0
174
Member Avatar for syria718

[CODE] deleteCont(){/*function in deleting contacts*/ printf("enter contact you want to delete: "); getchar(); fgets(find,100,stdin); j = 0; while(strcmp(contacts[j],find) != 0){/*start of while loop*/ if (strcmp(contacts[i],find) == 0){/*start of first while loop*/ printf("you want to delete %s",contacts[i]); size = strlen(contacts[j]); for(i = 0 ; i < size ; i++){/*start of 2nd …

Member Avatar for syria718
0
138
Member Avatar for tubby123

I am finding the recursion very difficult on this one. Could someone explain this to me. If this is a famous algorithm, a link containing the explanation would also do. I thought probably a couple of magic lines from you would change the way i am looking at this. I …

Member Avatar for nezachem
0
90
Member Avatar for mtatadotcom

hello, i need help with this sub program, everything ele works fine except the subprogram that should compute the smallest and largest number in the array [CODE] #include<conio.h> #include<stdio.h> #define MAX 10 int input(void); int range(int i,int *s1,int *s2,int *s3,int *l1,int *l2,int *l3,int f[MAX],int hf[MAX],int lf[MAX]); void output(int v,int s1,int …

Member Avatar for mtatadotcom
0
187
Member Avatar for DarkPyros

i wrote a program to take text from a file of my choice named "data" and print it out on the screen, how can i tweak this so taht when the text comes out , it would be all in upper case using toupper?? this is the code [CODE]#include <stdio.h> …

Member Avatar for DarkPyros
0
219
Member Avatar for syria718

please help me fix these problem,,,, when i'm running the program it exits emediately [CODE]main()/*Start of the function main???*/ { do{/*do while loop initialization*/ print(); scanf("%c",&choice1); switch(choice1){ case 'A': case 'a': addContact(); break; case 'F': case 'f': search(contacts); break; case 'v': case 'V': list(); break; case 'e': case 'E': edit(contacts); …

Member Avatar for syria718
0
179
Member Avatar for Graphix

Hi, At the moment I am trying to open a log file with notepad.exe while the original process continues. As I am developing for Windows, fork() is not available for me. I googled alot and found a good reference to opening processes ([url]http://www.yolinux.com/TUTORIALS/ForkExecProcesses.html[/url]), however they all put the original process …

Member Avatar for Graphix
0
288
Member Avatar for tubby123

Hey, i was trying to implement the sqrt function in c, and this was what i came across, and it works abs fine. But i dont get this , is this a standard logic based on Taylor, Maclaurin or something ? Is this more of a programming question or a …

Member Avatar for nezachem
0
205
Member Avatar for reza.adinata

Hi, I am starting to learn C programming. I recently stumbled across a structure below #include <stdio.h> #include <stdlib.h> [CODE] #include <stdio.h> #include <stdlib.h> typedef struct { int value; } fteid_t; typedef struct { fteid_t *fteid; // Optional Ins 0 } context_t; typedef struct { context_t default_bearer; } send_request; [/code] …

Member Avatar for reza.adinata
0
126
Member Avatar for murugavadivel

Getting Error after installing Turbo C.... how to rectify this problem.... Reply to this E-mail id: [email removed] ERROR: Sorry, unrecoverable internal error. Press ESC. EXCEPTION 13:general protection fault at 036F:3253 error code 0000 ax=0000,bx=0000,cx=0005,dx=0000,di=0000,si=0001 ds=069F limit=FFFF segment# 004D C:\TC\BIN\TC.EXE es=0000 limit=INVL segment# cs=036F limit=3881 segment# 001A C:\TC\BIN\TC.EXE ss=069F limit=FFFF …

Member Avatar for Salem
0
397
Member Avatar for DarkPyros

Hey, this code accepts data (type int) into a 4 by 4 array. im using 1234 as an example when entered, the data would be stored as: 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 the code the rotates it once to …

Member Avatar for DarkPyros
0
198
Member Avatar for acnodnem

I'm making a program that calculate wages, but I'm having problems in seeking the rates in the file, an example of one table.[URL="http://3.bp.blogspot.com/_xrZFmlhX0Ts/SYofqkmc1bI/AAAAAAAAO-Y/XfgESqYqZms/s400/tabela+2.JPG"]http://3.bp.blogspot.com/_xrZFmlhX0Ts/SYofqkmc1bI/AAAAAAAAO-Y/XfgESqYqZms/s400/tabela+2.JPG[/URL] the function receiving the salary and number of dependent, will seek in the file for the correct rate that this person as to pay. I thought of …

Member Avatar for acnodnem
0
231
Member Avatar for Graphix

Hi, Recently I started working on a project (it's called 'fd') that needs to retrieve the current processes running. It is written in C using the WinAPI. I am running Windows XP SP3 and am using MinGW compiler with Code::Blocks. After much searching I found the PSAPI to provide the …

Member Avatar for m4ster_r0shi
0
964
Member Avatar for neah
Member Avatar for Adak
0
45
Member Avatar for melfoy

Hey , i am new to data structure and specially Graph . And i was going through a problem for finding the best path [url]http://www.codechef.com/JULY11/problems/LOKBIL/[/url] And couldn't think something usable. SO , if u guys help that will be a good start of me on this site too. PS i …

Member Avatar for alwaysLearning0
0
261
Member Avatar for Abhishek1857

whenever I start programing,i.e. #include<stdio.h> and compile it. An error is shown and message is displayed as "unable to open the file stdio.h". Please help me to remove the error.

Member Avatar for D33wakar
0
102
Member Avatar for rachelir

I have set up the following structs: [CODE]typedef struct lineList { int lineNum; struct lineList* Next; }*Line; typedef struct DictionaryList { char* word; Line lines; struct dictionaryList* Next; }*Dictionary; and then I have defined: Dictionary head = NULL; /*is a pointer to head of dictionary list */ Dictionary node = …

Member Avatar for arkoenig
0
231
Member Avatar for asrockw7

[CODE] typedef struct bunny_info{ /* MORE MEMBERS HERE */ struct bunny_info *nextBunny; }bunny; bunny *make_bunny(){ bunny *bunnyPtr; /* SOME CODE HERE */ return bunnyPtr; } bunny *makebunny(bunny *bunnyList, short int makeCount){ bunny *newBunny = NULL, *endPtr = bunnyList; while(makeCount > 0){ if(bunnyList != NULL){ bunny *temp = bunnyList; while(temp->nextBunny != …

Member Avatar for Narue
0
189
Member Avatar for Shizuo

We have given an individual assignment about a simple atm program which withdraw and check balance, sounds simple? here's the twist, the atm database have money inside with denominations 1,000bill, 500bill and 100bill ,20 pieces each , so once the user withdraw cash, it should output how many 1000,500,100 bill …

Member Avatar for Shizuo
1
131
Member Avatar for surender_kumar

Hi friends I am a beginer in C. I want to make a simple program in which there are two balls on the screen. These two balls will Strike when the user presses any key ? Please help me with full code snippets.

Member Avatar for pseudorandom21
1
329
Member Avatar for jejak

Hey everyone. I'm really need help for important assignment. I need submit before 10 Jully 2001. but i'm stuck with my task. Can someone help to correct my assignment. Thank so much. Love u all.. This might a simple program but i really stuck.. help !!! QUESTION 1 As a …

Member Avatar for Adak
0
680
Member Avatar for gman1991

[CODE]//====================================================== //this is the grading sorting program for part one //====================================================== #include <stdio.h> #include <stdlib.h> #include <string.h> #define SIZE 10 int main() { FILE *ifp; // file pointer, points to the file char filename[32]; // store file name int ID [SIZE],grade[SIZE]; int i; int sum_grades = 0; //opening file by …

Member Avatar for Salem
0
133
Member Avatar for alex1050

[CODE]int main() { // stating my primivative data types and variables float num1,result; char symbol, choice; printf("Calculator Is ON\n"); do{ result=0.0; //assign 0.0 to result printf("Result=%.1f\n", result); scanf(" %c",&symbol); while((symbol!='r') && (symbol!='R')) { scanf(" %f",&num1); switch(symbol) { case'+': result=result+num1; printf("Result = %.1f\n",result); break; case'-': result=result-num1; printf("Result = %.1f\n",result); break; case'*': …

Member Avatar for alex1050
0
120
Member Avatar for barttoo

Hi guys, planning to do my masters in computer science. I'm very R&D oriented and interested in scientific software. Currently i'm a C# developer in multi-threading environment. I'm pretty comfortable in c/c++ as well. Looking forward to master a subject. Stuff that i'm interested are computer architecture, image processing and …

Member Avatar for \007
0
278
Member Avatar for pori044

Hello everybody. I m very new at c programming and know nearly nothing.I want to learn c programing like a professional. What can I do please help me......

Member Avatar for jingda
0
19
Member Avatar for Member #776446

I have heard that games can be built using c language. I request someone to post the code for a simple game.(if possible,simple code too)..

Member Avatar for imkj
-1
243
Member Avatar for bhallarahul

[CODE]#include<stdio.h> #include<conio.h> void pass(int); void main() { int a=23; int c; clrscr(); pass(a); printf(" %d ",c); getch(); } void pass( i) { //int i; if(i>40) return 1; else return 0; } [/CODE]

Member Avatar for Narue
0
166
Member Avatar for pril

[code]#include <stdio.h> #include <stdlib.h> int main() { int numbers[10] = {12,33,51,1,-1,97,7,23,0,-99}; sort(numbers,10); display(numbers,10); return 0; } void sort(int *numbers, int size) { /* Hop you could help me provide codes to sort the numbers. after calling this function, the numbers array in main should be sorted. hint: use the size …

Member Avatar for Narue
0
218
Member Avatar for CodeAerial

I am making a program the enqueues a number at index 0. I also made a function for it, as written below: [CODE] //main #include <stdio.h> #include <stdlib.h> #include "functions.h" main(){ int *queue = NULL; int size, choice, aNumber, numberOfQueues; do{ printf("Enter Array size: "); size = input(); allocateMemory(&queue, size); …

Member Avatar for nezachem
0
174
Member Avatar for vaishnu

Hi all I need to convert an [B]intel hexadecimal file[/B] into a [B]binary file[/B]. Intel hex files have a specific format. i am aware of the format but I dont knw how to convert it.. :( Can u pls help me... Link for Intel hex format. [url]http://en.wikipedia.org/wiki/Intel_HEX[/url] Thanks in advance

Member Avatar for vaishnu
0
300
Member Avatar for DarkPyros

hey, this is supposed to collect data into a 2 by 3 array. believe it or not, my teacher wrote this problem and he spent 20 minutes trying to figure out why it wasn't running properly. anyone care to help me figure out what was wrong with it?? [CODE]#include <stdio.h> …

Member Avatar for Aia
0
176
Member Avatar for alex1050

I need help understanding the do-while loop in this code. Im confused in how this do- while works because what i understand is the statement is executed then the expression is evaluated if nonzero and executes whats in while(). But its a loop so for example if i type Jack …

Member Avatar for Aia
0
211
Member Avatar for krabz01
Member Avatar for asrockw7

So I've finished C in school. Finished a Deitel book about C(The C part at least) though unprescribed. I know there's more, but 'how to' books isn't going to cover it. The school library isn't helping. I want more indepth info/lessons about C and I don't know where to go/begin …

Member Avatar for asrockw7
0
461
Member Avatar for sachinchandora

i have a error in c graphics "segment exceeds _TEXT 64K" i reduce some lines but i have no solution please help me as soon as possible i want to complete my program as soon as possible please help me some one

Member Avatar for Salem
0
1K
Member Avatar for wani_raj

I want to write a program which simulate the behaviour of CSMA/CD protocol over Ethernet.

Member Avatar for ryu_hemt_always
0
2K
Member Avatar for manaila

Hi I have a large C program which executes continuously, that is [I]listening[/I] to the user inputs, it is in an event loop. Now I want to have two different functions in that code to be executed simultaneously, in parallel. I tried to use fork() but the problem is in …

Member Avatar for manaila
0
177
Member Avatar for macla
Member Avatar for sshejale
Member Avatar for Hesham Moustafa
Member Avatar for tubby123

Hey, is there a function/call in c in windows to find the place from where your C-Development Environment is running. For example, (in case of Turbo-c), MOSTLY it is C:\TC\bin. Can i find this from within the program and output to a string or something ???

Member Avatar for TrustyTony
0
105
Member Avatar for anithakc

Hi please find this simple program, not sure why realloc is not working and its causing memory leak. But if calloc and malloc is used with little changes it works fine. [CODE]#include "string.h" #include "stdio.h" #include "stdlib.h" char *mystrcat(char*, char*); void main(void){ char str1[] = "quick brown fox"; char str2[] …

Member Avatar for anithakc
0
368

The End.