Here are two different methods of allocating and freeing a dynamically allocated 2D array. #include <stdio.h> #include <stdlib.h> int...
1. main returns int, not void 2. (*fgets(buffer,(BUFFER_LEN-1),fp) != '\0') When fgets() reaches the end, it returns NULL. Then when you try...
So have you done any research into the problem or not? Is your list a single linked list, or a double linked list ? Because the solution is...
I think you also need a CMidpoint::operator / which takes an int as a parameter, and you use that parameter in your division.
You were pretty close! #include <stdio.h> void *foo ( void *msg ) { printf( "%s\n", msg ); return msg; } typedef void...
> 1. When will memory allocation fail? Typically when you run out of memory, or the pool has become too fragmented that no large blocks remain....
Does a + b = c work for you for when you use say doubles? I doubt it. lvalue = rvalue_expression is written into the language. You can't just...
> a + b = c; Try c = a + b;
The loop reads the word, one letter at a time, until it reaches the end of the word.
Can you post the structure which is used to declare your read_data ?
The source code is portable, not the resulting executable. You copy your .c file to your Linux box, and use gcc to compile it. You copy your...
Lots more answers here - http://cboard.cprogramming.com/showthread.php?t=96339
Well it expects an array of pointers, what more is there to understand? They're not the same thing. An array of arrays...
For any array, say int arr[2][3][4]; You can prototype your function as void foo ( int arr[2][3][4] ); And define your function as void...
The first is an array of arrays, the second is an array of pointers. Compare the results of trying strlen(a[0]) and sizeof(a[0]) for both ways...
The short answer is "you can't", not in standard C. Given enum colours { red, green, blue }; there is no quick and easy way of getting the...
Because a should be an array of pointers, not an array of arrays. char *a[] = { "sample.sh", "one", "two", "three", NULL };
You can't have a struct containing less than 1 byte in C or C++. I'm guessing you declared a bit-field struct foo { unsigned int bits :...
http://www.daniweb.com/forums/thread97728.html
Oh, you mean this pointless trick? http://c-faq.com/expr/xorswapexpr.html
Separate names with a comma.