What does this error mean?

Here is my code:

#include <iostream>
using namespace std;
int salary(int);
int main()
const float r = 0.03;
float money, t = 10, c = 18,000, salary = c*(1 + r)*t*t;
cout << "Total Money = " << total <<endl;
cin.get ();
return 0;

and I get these errors, what do they mean and how do I fix them?

salary.cpp: In function ‘int main()’:
salary.cpp:6:29: error: expected unqualified-id before numeric constant

Last edited on
This is not a valid initialisation: c = 18,000
try either c = 18000 or c = 18.000 instead (depending on what you really meant).

Last edited on
Try declaring and initializing each variable on its own line.
Topic archived. No new replies allowed.