[ale] gcc programming

Fulton Green ale at FultonGreen.com
Sat Jan 22 21:36:21 EST 2005


On Sat, Jan 22, 2005 at 09:23:40PM -0500, ringo wrote:
> Is this a good forum for asking programming questions or is there a
> better one for gcc?

Well, if it's good enough for a long Comcast static IP discussion ...

> 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?

Google for the fprintf() syntax.  Use stderr (NOT "stderr") for the first
arg.  If you get compile errors, you're probably not including the right
header files.

Then run the program with the usual arguments but also add the following
argument set (assuming you're in a Korn shell or Bash command-line):
   2>yourTextFile.txt



More information about the Ale mailing list