Hi everyone, I'm trying to display the sentence "my name is james" in main() using class. But I could not figure out what's giving me error in this code. Can somebody tell me what is wrong with this code please? Thank you so much!
You don't need getName() function inside your constructor, because it already sets name to the string from the parameter. getName() doesn't need a parameter, since you want it to return the private member name. So it should be something like : string getName(){ return name}