Hello - first post here - hopefully someone can help
Im fairly new to C++, I've got MS Visual and I was experimenting the other day and came across a problem.
I found a simple script and entered it into MS Visual.
So I entered that into MS VIsual, Complied it and found the finished product.PHP Code:
#include <iostream>
using namespace std;
void main()
{
int min=0, max=0, i=0;
cout << "Input your first number to count from: ";
cin >> min;
cout << "Input your last number to count to: ";
cin >> max;
for(i=min; i <= max; i++)
{
cout << i << endl;
}
}
I opened the .exe and the black screen appeared.
It asked me for the first number - I entered it
It asked me for the second number - I entered it
Then as soon as I have pressed return it showed me the numbers inbetween for about 0.1 of a second and shut down.
I know that after I press return it should say "press any key to continue" On mine - it doesnt.
So basically does anyone know why is executes after that command, and how I can fix it...
By the way I have tried with more than one script and it always shuts down at the end.
Thanks in advance
Mark