GoAskAlice
Programmer
I am wondering why this code caused an error in C++ compiler under Windows when it compiles fine under Linux with GCC.
The error is with the calloc line. I can not give a specific error message as I am on my Linux box and would need to upload the file to my Windows laptop via my web server and configure a workspace under Visual Studio to compile the code. Its a hassle.
I am just curious as to why there is an error under C++ compiler and not with GCC?
Code:
typedef struct {int key; int digit; char string[24];}person;
person *txPtr;
if( (txPtr = calloc( store, sizeof(person) )) == NULL) {
printf("txPtr:Insufficient memory\n");
abort();
}
The error is with the calloc line. I can not give a specific error message as I am on my Linux box and would need to upload the file to my Windows laptop via my web server and configure a workspace under Visual Studio to compile the code. Its a hassle.
I am just curious as to why there is an error under C++ compiler and not with GCC?