Hello.
I started learning C++ about 2 or 3 days ago, learning from quite a few books. I created a simple converter from feet to metres.
It works fine in Code Blocks (after pressing F9) but when I find the .exe file in the folder, open it, write the feet amount and when I press Enter it converts but it closes straight after. So the window is only visible for less than half a second.
Any suggestions?
#include <iostream>
using namespace std;
int main()
{
int feet ;
float meters ;
float converter = 0.3048 ;
cout << "Give the amount in feet: " ;
cin >> feet ;
meters = feet * converter ;
cout << "\n" ;
// ----- results
cout << feet << " feet equals to "
<< meters << " meters \n" ;
cout << " \n\n" ;
}