This probably comes from the word String
in the arguments to your main()
function. There is no class, function, variable, etc. named String
known to the compiler, so it gives an error. You'll probably get the same error from this program:
int main() { String s; return 0;}
In this latter case, if you add a class named String
, then you can get it to compile:
class String {};int main() { String s; return 0;}
As cigien mentioned in the comments, your code looks like Java code and is not valid C++, so you'll have a lot more things to fix before you can get it to compile. Fixing all those things is beyond the scope of this site. I just mentioned the likely cause of the one error you asked about.