[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] gcc programming
- Subject: [ale] gcc programming
- From: unixdude at gmail.com (Jim Patterson)
- Date: Sat Jan 22 21:54:10 2005
- In-reply-to: <0bcd01c500f2$91557670$bb00a8c0@Ringo>
- References: <[email protected]> <0bcd01c500f2$91557670$bb00a8c0@Ringo>
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.