Aww HeLp!!

Started by
6 comments, last by Maledict 18 years, 8 months ago
Hey Guys I just went out and bought myself a book and i downloaded the Dev C++ Compiler The thing is i seem to be having a problem which im sure is very easy to fix for u guys but im new and i need to be tought a few things. id write in the box and when i compile and run the dos screen comes up real fast and then leaves withen seconds of even knowing what was Can Some Help me out? all i can think of is thiers a typo Sumwhere. Here's the easy Demo !! (Sorry if its basic Everyone gotta start sumwhere!) #include <iostream> using namespace std; int main(){ cout << "Never Fear, C++ is here!"; return 0; }
Advertisement
Hey,
Try this code:

#include <iostream>using namespace std;int main(){     cout<<"Never fear!  C++ is here!"<<endl;     cin.get();}

\That will work. Also, Good Luck studying Programing.
Chad.
I believe if you add "cin.get();" after the cout line, the DOS window will wait for you to press a key, thus keeping it on screen. I've only been learning for about a month, so if anyone has a better way, I stand corrected.

EDIT: i guess this is a kind of "two-person" double post (same answer). He beat me by ten seconds. I would have gotten there before if I didn't forget to log in and so I had to retype
-----------------------------If pi is used to find the dimensions of a pie,Is cak used to find the dimensions of a cake?
haha Great It worked Thanks Guys Now i can actually start reading and learning NO more stoping me!

1 question thow How did u guys know that? Same experience Or just really smart!
Like everything else, it's just something you learn as you go. Personally, I use while(!_kbhit()); to do the same thing. I don't know if it's a deprecated function in the modern sense, but it works fine for me. Good luck!
.
Similar experience. I have done a little learning with Dev-Cpp and the CProgramming.com tutorials (although I plan to get a book when I'm done with my current VB.NET project for a school club). It covered that in the tutorials, and I played around on my own and I found it neccessary.
-----------------------------If pi is used to find the dimensions of a pie,Is cak used to find the dimensions of a cake?
Personally I like to use:
sytem("pause");


Mainly because it waits and outputs "Press any key to continue . . ." to the console.
Well, before I switched to VS.NET 2003 (handles that automatically), and used DevC++, I'd usually use cin.get(), but system("PAUSE") works well, also.

This topic is closed to new replies.

Advertisement