Hope this is the relevant forum to post it in. Well, I've tested a Source code and compiled it. I also made a program out of it. Now the problem is, that everytime i press enter the window/program closes. Anyone know what's wrong? Here's the code
//--------------------------------------------------------------------
//
// op2_1.cpp
//
#include <iostream>
using namespace std;
int main()
{
cout << "Write X inches and I will find the answer in ";
cout << "X centimeters for you." << endl;
cout << "Write in X inches: ";
double tommer;
cin >> tommer;
const double antcmPrTomme = 2.54;
cout << tommer << " tommer = " << tommer * antcmPrTomme <<
" cm" << endl;
return 0;
}
please help me.
Thanks a lot
Program Closing
Moved.
QUOTE (ADDKiD @ Dec 1 2006, 4:01 PM) <br>You guys make me laugh alot, half the shit I say, is bullshit...<br><br><img src='http://img485.imageshack.us/img485/492/banssig1ng.gif' border='0' alt='user posted image' /><br><br><b>I see no changes at all, wake up in the morning and ask myself...<br>Is life worth living? Should I blast myself?</b><br><br><b><a href='http://2paclegacy.com' target='_blank'>2PacLegacy.com</a></b>
Code: Select all
//--------------------------------------------------------------------
//
// op2_1.cpp
//
#include <iostream>
using namespace std;
int main()
{
cout << "Write X inches and I will find the answer in ";
cout << "X centimeters for you." << endl;
cout << "Write in X inches: ";
double tommer;
cin >> tommer;
const double antcmPrTomme = 2.54;
cout << tommer << " tommer = " << tommer * antcmPrTomme <<
" cm" << endl;
[B]system("pause");[/B]
return 0;
}
-><-
-
- Loyal fan
- Posts: 391
- Joined: Sat Mar 26, 2005 12:41 am
return 0; will close your program, or if ur debuging say press enter to close.
<img src='http://freewebs.com/trickro/70s.png' border='0' alt='user posted image' /><img src='http://freewebs.com/trickro/70s2.jpg' border='0' alt='user posted image' />