Hi all,
Trying to figure out some of these errors..Probably going to show how dumb I am again,but this is a simple for loop example and I was just adding system("pause")......and
[code]
#include <iostream>
using namespace std;
int main()
{
int a,b,s,i;
cout << "Enter Number: "; cin >> a;
cout << "Enter the power: "; cin >> b;
s = 1;
for (i=1; i <=b; i++)
s = s*a;
cout << s << endl;
system ("pause")
return 0;
}
[code/]
Dev 4.9.8.2
Compile log:
Compiler: Default compiler
Executing g++.exe...
g++.exe "C:\Dev-Cpp\Projects\ProjectCppFiles\SimpleForLoop.cpp" -o
"C:\Dev-Cpp\Projects\ProjectCppFiles\SimpleForLoop.exe" -g3 -O0 -ansi -g3
-I"C:\Dev-Cpp\include\c++" -I"C:\Dev-Cpp\include\c++\mingw32" -I"C:\Dev-Cpp\include\c++\backward"
-I"C:\Dev-Cpp\include" -L"C:\Dev-Cpp\lib"
C:/Dev-Cpp/Projects/ProjectCppFiles/SimpleForLoop.cpp: In function `int
main()':
C:/Dev-Cpp/Projects/ProjectCppFiles/SimpleForLoop.cpp:15: parse error before `
return'Execution terminated
I get this alot...what's the parse error before on the last line ??
BTW...in trying to learn these errors why :
Warning on int main ()
syntax error before >> ......etc, etc.
Anyplace I can get a list of these or is it just an experience thing??
I'm new to c++ and have been using VB....Visual Studio lets you debug before you compile which gives you a shot at figuring out your problems, but it seems here you just have to know the errors cause you can't debug until you can compile...( or am I missing something...there isn't a way to debug before you compile in Dev is there??)
Appreciate any input.......Thanks! Teeyester