[ale] gcc programming
Jim Patterson
unixdude at gmail.com
Sat Jan 22 21:54:10 EST 2005
On Sat, 22 Jan 2005 21:23:40 -0500, ringo <ringo at margaritasrus.com> wrote:
> I don't have my C book on me and I need to print debug info to a text
> file. Does anyone have a code snippet ob how to open a file and print to
> it?
Try this:
#include <stdio.h>
int
main()
{
FILE* fp = NULL;
fp = fopen("/tmp/debug.log", "a+");
fprintf(fp, "%s\n", "Your message here");
fclose(fp);
}
Jim Patterson.
More information about the Ale
mailing list