Hi
I am getting a malloc error with bus error on using the fprintf statements in C++ (code below). Any pointers on what could be going wrong? Note absAmb and dModel both have valid values. Thanks.
FILE *fPtr;
char fName[100];
sprintf(fName, "Info.dat", block);
if ( (fPtr = fopen(fName,"w")) == NULL )
{
return( FALSE );
}
int absAmb = rint(fda[0]/prf[0]);
fprintf(fPtr, " %d", absAmb); //ERROR LINE
fprintf(fPtr, " %d", dModel);
fclose(fPtr);