Archived

This topic is now archived and is closed to further replies.

SirGorthon

VC++ Compiler Problems

Recommended Posts

I wrote a simple program that basically displayed a line of text using cout and then got user input with getch. I've had several people look at my code and they say it should work fine, but when I compile, it displays nothing. If you hold down a button, it will wait a little bit and then display the text about 11 times. Is that a problem with my compiler or what? ** And also for some reason, I never have to put using namespace std... or anything related to it. When I do it generates an error. What do I fo to change that? [edited by - SirGorthon on August 12, 2002 10:29:12 PM]

Share this post


Link to post
Share on other sites
There are some things that may be affecting the output of your program.

First thing is what type of project are you creating? a win32 app, console app, or what?

are you including the correct headers?
is your linker including the correct libraries in order?

I''m sure there are other things that contribute to this so if you could give just a bit more information it may help.

commando_337

Share this post


Link to post
Share on other sites
If you are using <iostream.h> stop right now and use <iostream>.

Check your favorite C++ reference to know why. If it doesn''t explain, get a better reference.

Documents [ GDNet | MSDN | STL | OpenGL | Formats | RTFM | Asking Smart Questions ]
C++ Stuff [ MinGW | Loki | SDL | Boost. | STLport | FLTK | ACCU Recommended Books ]

Share this post


Link to post
Share on other sites
Huh? I've been using < iostream.h > (minues the spaces) What's the difference?
O_O DUDE! THANK YOU SO MUCH! I GOT IT TO WORK NOW! AND I ALSO HAFTA PUT using namespace std; NOW! I'm happy. ^_^

[edited by - SirGorthon on August 12, 2002 11:05:58 PM]

Share this post


Link to post
Share on other sites
iostream.h, fstream.h, strstream are deprecated prestandard headers to which you must substitute iostream, fstream and sstream respectively.


Documents [ GDNet | MSDN | STL | OpenGL | Formats | RTFM | Asking Smart Questions ]
C++ Stuff [ MinGW | Loki | SDL | Boost. | STLport | FLTK | ACCU Recommended Books ]

Share this post


Link to post
Share on other sites