Monday, May 24, 2010

I NeeD help with C++ ?

When i use This Code #include %26lt;iostream%26gt;





using namespace std;





int main (int argc, char *argv[])


{


cout %26lt;%26lt; "Welcome To My Program!" %26lt;%26lt; endl;


cout %26lt;%26lt; "Press ENTER to Continue..." %26lt;%26lt; endl;


cout %26lt;%26lt; "Hello, " %26lt;%26lt; "I am " %26lt;%26lt; "a C++ statement";








cin.get();


return 1;


}











How can i get it so it doesnt close and go to a next blank page

I NeeD help with C++ ?
normally you would want to retrun 0, meaning that your code exits with no error.





when you run the program from windows it will open and close a DOS window really quick so you can't see the output. If this is what you mean by your question? If you want it to remain then run it from a DOS window that is already open.





Run --%26gt; cmd


C%26gt; hello
Reply:If you're looking for some extra income you may find this interesting. What the hell, no one else is paying you to do stuff on the internet. I've made 500.00 bucks alone with this site just by doing surveys and free trials. This was all in just hours of my own free time...I hope you don't consider this to be 'spam' but I am seriously trying to help you out. Anyway, if you want to check it out for yourself and read up on it here's the site. And yes, it's totally free. After you register, check the 'Messages' tab to learn how to make the easiest money. No age requirement. Thanks for reading.





AND THEY PAY!!!





http://www.*************/index.php?ref=5...
Reply:I am not sure what system you are on, but I am using XP pro sp2 and it worked fine here. I tested clicking on the exe file and running it in the dos (command prompt) box.





The program waited for a return or enter key to be pressed before finishing. If you pressed any other key, like space, it did not close.
Reply:add something that pauses the screen.


for example:





#include %26lt;iostream%26gt;





using namespace std;





int main (int argc, char *argv[])


{


cout %26lt;%26lt; "Welcome To My Program!" %26lt;%26lt; endl;


cout %26lt;%26lt; "Press ENTER to Continue..." %26lt;%26lt; endl;


cout %26lt;%26lt; "Hello, " %26lt;%26lt; "I am " %26lt;%26lt; "a C++ statement";





system("pause");


return 1;


}








there is also a _getch() with include conio.h


that way u can say ur own message first and then get any key


http://msdn2.microsoft.com/en-us/library...


No comments:

Post a Comment