[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]



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


</pre>
<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<hr>
<!--X-Follow-Ups-End-->
<!--X-References-->
<ul><li><strong>References</strong>:
<ul>
<li><strong><a name="00870" href="msg00870.html">[ale] comcast static IP?</a></strong>
<ul><li><em>From:</em> pete.hardie at gmail.com (Pete Hardie)</li></ul></li>
<li><strong><a name="00872" href="msg00872.html">[ale] gcc programming</a></strong>
<ul><li><em>From:</em> ringo at margaritasrus.com (ringo)</li></ul></li>
</ul></li></ul>
<!--X-References-End-->
<!--X-BotPNI-->
<ul>
<li>Prev by Date:
<strong><a href="msg00875.html">[ale] comcast static IP?</a></strong>
</li>
<li>Next by Date:
<strong><a href="msg00877.html">[ale] comcast static IP?</a></strong>
</li>
<li>Previous by thread:
<strong><a href="msg00872.html">[ale] gcc programming</a></strong>
</li>
<li>Next by thread:
<strong><a href="msg00880.html">[ale] gcc programming</a></strong>
</li>
<li>Index(es):
<ul>
<li><a href="maillist.html#00876"><strong>Date</strong></a></li>
<li><a href="threads.html#00876"><strong>Thread</strong></a></li>
</ul>
</li>
</ul>

<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
</body>
</html>