I am wondering why this code caused an error in C++ compiler under Windows when it compiles fine under Linux with GCC.
typedef struct {int key; int digit; char string[24];}person;
person *txPtr;
if( (txPtr = calloc( store, sizeof(person) )) == NULL) {
printf("txPtr:Insufficient memory\n")...
Gosh, this sounds so easy! But, I am having serious problems.
I wrote a file using fwrite to record 9 number sequences of 8 digits each in length. No seperators, just a long line of digits went into the file.
Now, I want to pull a single digit from the file using fread but it really wont let...
Basically, I am learning C under Linux. What I am attempting is fwrite and fread functions on a file.
The write program works without fault, but when I try and read the data back from the file, the data is displayed, but then at the end of it all it states 'Segmentation fault'.
So, here is the...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.