Whenever I declare the function as a string, it gives me the error: "String does not name a type." If I try to return a string it says: "Invalid conversion from 'const char*' to 'int'. If I try to declare a string, it tells me: "String was not declared in this scope". I don't see anyway of doing it. I am using XCode on a mac.
In that case, I can think of two reasons why you're getting the "does not name a type" error:
1) You haven't included the string library (#include <string>)
2) You have included the library, but you haven't qualified string with std (std::string)