Society of Robots - Robot Forum
Software => Software => Topic started by: vipulan12 on November 10, 2013, 05:26:31 PM
-
hi, i am learnign c++ but the cin function isnt working?
i am using eclipse with minigw
cout works but not cin
when i enter a value on the console the program terminates
here is my code:
#include <iostream>
#include <stdio.h>
using namespace std;
int main ()
{
int i;
cout << "Please enter an integer value: ";
cin >> i;
cout << "The value you entered is " << i;
cout << " and its double is " << i*2 << ".\n";
return 0;
}
-
i was able to fix it after restarting closing and re opening the application why did that fix the program?