Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Codewarrior Windows > Re: writing to ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 5 Topic 244 of 318
Post > Topic >>

Re: writing to a non-open file crashes

by Howard Hinnant <hinnant@[EMAIL PROTECTED] > Jan 17, 2005 at 09:58 PM

In article <1105996076.803882.258250@[EMAIL PROTECTED]
>,
 "SiamGod" <ed.woods@[EMAIL PROTECTED]
> wrote:

> In CW9.3 under Win, the following code crashes:
> 
> int main()
> {
> ofstream Test;
> Test << " ASDF asdf" << endl;
> }
> 
> The same code does nothing on 8.3 , linux, .net and so on.  Is 9.3
> buggy?

Not to the best of my knowledge.  I'm not duplicating your symptoms 
here.  It is possible it that there is an inconsistent setting between 
your app and how MSL C++ was compiled.  Could you insert the following 
as the first statement in main?

   check(Metrowerks::msl_settings());

If an assertion fires, the text of the assertion should shed some light 
on the situation.  If an assertion doesn't fire, then I've guessed wrong 
and will continue to try and help.  And in that case, it would be 
helpful to know if the crash occurs under the << " ASDF asdf" or under 
the << endl.

-Howard




 5 Posts in Topic:
writing to a non-open file crashes
"SiamGod" <e  2005-01-17 13:07:56 
Re: writing to a non-open file crashes
Howard Hinnant <hinnan  2005-01-17 21:58:56 
Re: writing to a non-open file crashes
"SiamGod" <e  2005-01-18 05:42:14 
Re: writing to a non-open file crashes
Howard Hinnant <hinnan  2005-01-18 19:36:36 
Re: writing to a non-open file crashes
"SiamGod" <e  2005-01-18 14:10:55 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat May 17 5:31:58 CDT 2008.