java2
02-04-2006, 08:11 PM
just downloaded the dev C++ program. the pograms compile fine wihout any problems but when i run them the program closes when it reaches a "cout".
strangely the "cin" works fine so my guess is that its not a problem with the header.
#include <iostream>
#include <string>
using namespace std; int main()
{
string name; int ID; cout << "Enter your name ";
cin >> name;
cout << "Enter your ID number ";
cin >> ID;
cout << "Hello " << name << " or should I say " << ID << endl;
return 0;
}
Thanks in advance
strangely the "cin" works fine so my guess is that its not a problem with the header.
#include <iostream>
#include <string>
using namespace std; int main()
{
string name; int ID; cout << "Enter your name ";
cin >> name;
cout << "Enter your ID number ";
cin >> ID;
cout << "Hello " << name << " or should I say " << ID << endl;
return 0;
}
Thanks in advance