Posted by: chanaa_tarkaari July 14, 2007
Login in to Rate this Post:
0
?
Thanks Thapap and |<1$|-| for valuable suggestions.
Thapap's idea worked out to solve the compiling error message when I added
const void * (var [k][t]) ;
just before the fwrite statement. But it produced segmentation fault while running the program.
It is true the var[k][t] is declared as two dimensional double. The memory allocation is dynamic. Declaring const void*(var[k][t]) in the beginning of program caused further problem of conflict in declaration, with the following error message.
error: conflicting declaration 'const void*var[((long unsigned int)((long int)k))][((long unsigned int)((long int)t))]'
All examples I could find on fwrite illustrate just writing character type data array. Could not find any good referece to write the numeric data array in binary form,