[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] gcc programming
- Subject: [ale] gcc programming
- From: esoteric at 3times25.net (Geoffrey)
- Date: Sat Jan 22 21:58:45 2005
- In-reply-to: <0bcd01c500f2$91557670$bb00a8c0@Ringo>
- References: <0bcd01c500f2$91557670$bb00a8c0@Ringo>
ringo wrote:
> Is this a good forum for asking programming questions or is there a
> better one for gcc?
> 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?
This is probably as good a place as any I suspect.
You'll likely want to write the debug info to standard error and capture.
Here's how I do it in C so that I can track where the data was spit out:
(void)fprintf(stderr, "%s %d: %s\n", __FILE__, __LINE__, debugdata);
Then when you run your program, do this:
program 2> program.err
--
Until later, Geoffrey