Jump to content
  • Advertisement


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


Advice needed please

This topic is 5235 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi Everyone Ok I have started to learn c++ which I am enjoiying, I just need a couple of questions answered please. 1. Can anyone tell what the key is after the letter d in << endl; (this has been pasted as I still cant find it), it looks like the number one,I have been pressing every key on my keyboard and cant find it ( Or am I just stupid????). 2. I am using the free complier from bloodshed which is cool but when ever I Compile & Run my codes I press F10 but cant get the Dos results window to stay up long enough for me to see the outcome????? Please help this puzzled beginner Many Thanks

Share this post

Link to post
Share on other sites
The last letter in endl is an L.

You should add code that waits for a keypress before it exits.

[edited by - tiffany_smith on April 21, 2004 5:53:02 PM]

Share this post

Link to post
Share on other sites
I too am learning C++ AND using the same compiler .
The character after the d in endl is the letter l.
(A way to remember this is know that endl is just short for "end line")

As with the problem with DOS, there are two ways. The first(The one some beginner tutorials mention) is the long way.
This is to open the command prompt (Usually under Program:Accessories) and type the path(i.e. if you have a file named "Count" in a folder named "C++" in the C drive then you would type in :
C:\C++\Count. A MUCH easier way is what Tiffany_Smith suggested; Have an additional line at the end (BEFORE return 0; ) of your program that waits for user input. i.e.

int x;
std::cin >> x;
This will wait for the user(or in this case, the programmer) to input a value(This is where you can check the program).
After you're done, just enter a number and the number will be stored in the variable, but since return 0; is right below
cin >> x; the program will simply discard this value.
I hope that helped, good luck with programming!

"Eagles may soar, but weasels don''t get sucked into jet engines."

[edited by - AtmaStorm on April 21, 2004 8:17:10 PM]

Share this post

Link to post
Share on other sites
Also, if I remember right, you could use


or after including

cout<<"Press any key. . .";

Both will do the same the thing. Ah, I haven''t programming in C++ for a while. Beautiful stuff.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!