Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Debug Assertaion Failure

Status
Not open for further replies.

AndyHollywood

Programmer
Oct 7, 2001
30
GB
Does anybody know why I would get a debug assertion failure when i run my program? It seems to happen when when i try to output to a text file with the following code;

FILE *pKBLog;
/*DLL ATTACH*/
pKBLog = fopen("d:\\logs\\_kblog.txt", "w"); /* Open log */
fprintf(pKBLog, "Andrew/n");

/*DLL DETACH*/
fclose(pKBLog);

For some reason i get an assertion error, evem though from what i have read i am using the functions properly.

Hope some one can help me

Cheers in advance

Andy :eek:)
 
maybe if you gave a hint what assertion and where... :) Hope that this helped! ;-)
 
oh yeah..sorry

Its in:
File: fprintf.c
Line: 56
Expression: str !=NULL

and while debugging the dll it happens when it trys to execute the follwoing line:
fprintf(pKBLog, "Andrew/n");

Hope that helps

Andy
 
It suggests that the fopen() failed and the file pointer is null. :) Hope that this helped! ;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top