[LCP] Question on setfub
Ludwig Isaac Lim
ludz_lim at yahoo.com
Fri Jul 20 02:36:28 UTC 2007
Supposing I have the following functions:
void write_helper (FILE *fp)
/* write stuff to fp */
char buff [MY_BUFF_SIZE];
fp = fopen("somefile","w");
setbuf(fp, buff); /* allocate buffer for fp */
fwrite(....,fp); /* write to buffer */
Is the buffer declared in main_writer() visible in
write_helper()? I mean, will the fwrite() in fp writes to
same buffer in main_writer()? Is the above code ok?
Moody friends. Drama queens. Your life? Nope! - their life, your story. Play Sims Stories at Yahoo! Games.
More information about the linuxCprogramming