Daniel,
Thanks for the reply. Got an answer to my question on another forum. The
following initializes a 'bit bucket' file pointer:
fpout = fopen("NUL:","w"); // for win32
fpout = fopen("/dev/null","w"); // for unix
Scott
-----Original Message-----
From: Daniel Glenfield [mailto:sp...@ho...]
Sent: Friday, November 08, 2002 8:26 AM
To: se...@al...; dev...@li...
Subject: Re: [Dev-C++] Is there a "garbage" stream?
You could always try using a #IF but you still need to change your code.
sorry, I'm all out on that one!
>From: "Scott Williams" <se...@al...>
>Reply-To: <se...@al...>
>To: "Dev-Cpp-Users@Lists. Sourceforge. Net"
><dev...@li...>
>Subject: [Dev-C++] Is there a "garbage" stream?
>Date: Thu, 7 Nov 2002 15:26:59 -0500
>
>Hi,
>
>Here's my problem. I have C code that does a bunch of number crunching,
>spitting out intermediate results to the output files along the way.
>However, in some applications, it would be preferable to NOT write any data
>to output files (e.g., when the program is run iteratively in an nonlinear
>optimization routine).
>
>Rather than hunt through my code to find all the instances of
>fprintf(fpout,
>...) and insert a conditional statement, it would be much easier (and
>cleaner) if I could simply initialize the file pointer to a stream going
>nowhere.
>
>I've tried setting fpout = NULL but that doesn't work. Any suggestions?
>
>Scott
>
>
>
>-------------------------------------------------------
>This sf.net email is sponsored by: See the NEW Palm
>Tungsten T handheld. Power & Color in a compact size!
>http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en
>_______________________________________________
>Dev-cpp-users mailing list
>Dev...@li...
>TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
>https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*.
http://join.msn.com/?page=features/featuredemail
|