Hi,
I'm learning FOR loops and have made this code:-
Code:
using namespace std;
int main()
{
int array1[2];
int i = 0;
int total = 0;
int semitotal =0;
for(i=0;i<3;i++)
{
cout << "Enter a number " << endl;
cin >> array1[i];
}
cout << "outside 1st FOR loop" << endl;
for(i=0;i<2;i++)
{
cout << "number was" << array1[i] << endl;
}
cout << "outside 2nd FOR loop" << endl;
for(i=0;1<3;i++)
{
array1[i] = semitotal;
semitotal += total = total;
}
cout << "outside 3rd FOR loop" << endl;
cout << "array total is" << total << endl;
//cin.get();
system("pause");
return 0;
}
When I build it in Visual Studio it always says the following:-
The following breakpoint cannot be set:
At int loopcount;
Unable to parsethe function:int loopcount;
So I installed Dev C++ and it runs the program, but the console window won't remain open despite trying both cin.get(); and system("pause"); .
Could anyone offer me out with either these two issues?
Many thanks.