This probably sounds like a dumb question, but I am just trying to write an integer to an output buffer, then write the output buffer to a file:
/* Declaratives */
char rptbuf[197];
input_cnt_msg[] = "Total Input Records Read .......... ";
int input_rec_cnt = 0;
;
int main()
{
FILE *reportPtr;
/* ...... input_rec_cnt is updated in program ..... */
rptbuf[0] = '\n';
z = 1;
for (j=0; j<34; j++, z++) {
rptbuf[z] = input_cnt_msg[j];}
rptbuf[z] = input_rec_cnt;
fputs(rptbuf, reportPtr);
}
I know this isn't right. I have tried several ways .... even moving the integer to a string, then moving that one byte at a time to the output buffer. Nothing works.
Any suggestions? Sorry if this is a stupid question, but I'm new to this language and can't find it in the book.
Thanks,
muffin