how to free this935 (1/7/2008 9:41:24 PM) comp.lang.c What is the correct way to free arrays allocated like this (from C FAQ):int **array2 = (int **)malloc(nrows * sizeof(int *)); array2[0] = (int *)malloc(nrows * ncolumns * sizeof(int)); for(i = 1; i < nrows; i+... copx(116)
question #183330 (1/13/2008 3:11:39 AM) comp.lang.c I wrote this small program to read a 512 block of binary data and write the same to a file. My code compiled well. The only thing is when I ran the compilers binary instead of a data file of 512 bytes I g... nospam268(588)
Urgent C Questions9645 (1/15/2008 2:41:56 AM) comp.lang.c 1. in the prg bellow what vars are stored on stack, heap, data segment? int i; void main() { int j; int *k = (void *)malloc(1); } (I think j and k are on stack, but where is ... hans8628(20)
Textual data files in C724 (2/5/2008 1:05:10 AM) comp.lang.c Hi all! I'm trying to read textual data files in C, but I'm still not sure what the best design might be. All data files have this format ----sample data--- SOME_ID_IDENTIFYING_FILE_TYPE data_record[0] data_r... franz_hose_1993AD(8)
preprocessor in c525 (2/14/2008 1:42:02 AM) comp.lang.c first here is the code >>>>>>>>>>>>>>>>>>>>>>>>>>>>> /*errors.c*/ #include #define MAX 1000 /* this is the main function */ int main(){ prntf("hello\n"); //const float pi = 3.0; rturn 0; } >>>>>>>>>>>>>>>>... lwjct(1)
level order traversal of binary tree436 (2/14/2008 2:01:40 PM) comp.lang.c Dear all, How good is this function which implements level order traversal of binary tree ? level_trav(struct node *sn) { struct node *queue[MAX]; int front = rear = -1; front++; rear++; queue[rear... sophia.agnes(81)
.h files530 (2/21/2008 5:01:56 AM) comp.lang.c Ok I have a doubt regarding .h files. I basically have two modules in my software program - a.c and b.c There is .h file called d.h. d.h contains prototypes of functions in a.c so whenever i have to use funct... johnnash86(30)
Compile error at testing Function Pointer928 (2/27/2008 6:09:23 AM) comp.lang.c When I compiled this C source, a C compiler spat out a message which was "Declaration syntax error in function main()". I am having tested function pointer example program. Of course, I am a novice at C so that... emir(7)
printf() and void *3324 (3/2/2008 5:59:19 PM) comp.lang.c I recall from previous discussions here, that we must cast a non-void pointer to void * before printing its value with printf("%p"). Is it true, and if yes why? ... ivranos(429)