Oct 2, 2002 #1 drrep Programmer Mar 13, 2002 47 US Hi, Just wanted to know if there was a way to use fputs to output a boolean value (1 or 0) to a file. I seem to be having trouble with that Thanks in advance
Hi, Just wanted to know if there was a way to use fputs to output a boolean value (1 or 0) to a file. I seem to be having trouble with that Thanks in advance
Oct 2, 2002 #2 victorv Vendor Aug 20, 2002 862 IT hi, fputs writes "null termianted string" on file (as fprintf) If you want use fputs, before you have to use a dummy string char dummy[10]; sprintf( dummy, "%d", myboolval ); fputs( ... dummy ......) ; or easier fprintf( mystream, "%d", myboolval ); that's all. Upvote 0 Downvote
hi, fputs writes "null termianted string" on file (as fprintf) If you want use fputs, before you have to use a dummy string char dummy[10]; sprintf( dummy, "%d", myboolval ); fputs( ... dummy ......) ; or easier fprintf( mystream, "%d", myboolval ); that's all.