Saving

Started by
14 comments, last by Chad Smith 17 years, 4 months ago
I think the problem in your code is your using "cout" and "endl" w/o the "std::" prefix.

One way around having to write that a lot is to put this in your code:

using namespace std;


Note, however, that this method is only recommended for larger apps, because it takes up a few to many resources for something as simple as "Hello, world".
Advertisement
Quote:Original post by RavynousHunter
I think the problem in your code is your using "cout" and "endl" w/o the "std::" prefix.

One way around having to write that a lot is to put this in your code:

*** Source Snippet Removed ***

Note, however, that this method is only recommended for larger apps, because it takes up a few to many resources for something as simple as "Hello, world".


Say what?

If anything, a using declaration like that is ONLY recommended for very small projects. A using declaration doesn't use any resources of any kind whatsoever. It is a compile-time only thing.

The larger the project, the greater the chance of a name-clash, so the less you should be using global using declarations like that.

Also, while ommitting the std:: from cout etc may have prevented the OP's application from compiling, it is not very likely to have been the cause of a run-time crash.
Okay it doesn't show that specific error anymore but now anytime i click anything (like exit compile, debug, new _____ etc.) it says Out of Memory....

More help please :)
Quote:Original post by EasilyConfused
Quote:Original post by RavynousHunter
I think the problem in your code is your using "cout" and "endl" w/o the "std::" prefix.

One way around having to write that a lot is to put this in your code:

*** Source Snippet Removed ***

Note, however, that this method is only recommended for larger apps, because it takes up a few to many resources for something as simple as "Hello, world".


Say what?

If anything, a using declaration like that is ONLY recommended for very small projects. A using declaration doesn't use any resources of any kind whatsoever. It is a compile-time only thing.

The larger the project, the greater the chance of a name-clash, so the less you should be using global using declarations like that.

Also, while ommitting the std:: from cout etc may have prevented the OP's application from compiling, it is not very likely to have been the cause of a run-time crash.


Of course, its is entierly possible that I got it backwards, I tend to do that sometimes.

Personally, I don't see a thing wrong with his program at all.
Quote:Original post by pissoffboi
Okay it doesn't show that specific error anymore but now anytime i click anything (like exit compile, debug, new _____ etc.) it says Out of Memory....

More help please :)


hmm how much ram do you have ?
how much free space do you have on your C drive ?

(could it be as simple as your computer running out of both physical and virtual memory ?)
[size="1"]I don't suffer from insanity, I'm enjoying every minute of it.
The voices in my head may not be real, but they have some good ideas!
I got the exact same error when I used Dev-CPP. I could never solve it. I now use Visual C++, and I love it! Visual C++ is a professional IDE also.


That is just what I suggest.


Chad.

This topic is closed to new replies.

Advertisement