Hey so im working on this problem I dont understand how im getting it wrong Im following the syntax just like how they have it explained. Can I get some pointers on what I am not getting.
Could it be as simple as a missing keyword, ‘function’?
Be careful with
string here, that could cause you trouble. I’m not sure the provided error is all that helpful but all you want here is the declaration, not a definition, of your method.
Both your method declarations should look more like the following short example (under public)-
They want you to write the definitions in a separate file.
is that because using namespace std; is not written? because I added it and still gave me the same error. what is the difference on it?
In terms of namespaces, yes,
string would not be directly available in this scope unless you added that namespace with
As for an error I’m not sure what code you’re now using and what error you received. Have you changed your methods to just be declarations as per the second part of the previous post?
See How do I format code in my posts? so we’re not left guessing.
thanks I got I got the answer correct now but it doesn’t make sense though because when you learn variables earlier they dont even require that you write that and it still works fine if I were to write
Unfortunately you can’t be sure what tests are going on in CC environment, there’s no guarantee the code is compiled or tested as there’s simpler routes to check just the contents of a file or similar. I’d advise trying to compile this on your own device and viewing the result for yourself if you want to be sure.
As a quick test-
ah wow ok I see thank you!
I never seen variables with std:: I thought that was only a cout thing.
It’s the namespace for the standard libraries and there are quite a lot of possibilities…
Long strong short you’ll probably be seeing a lot of it