9 Answers
New AnswerYou are defining isTrue() twice instead of having a declaration and a definition, which results in the second one not having a proper declaration. If the second one is the method you want, replace the definition inside the structure by the corresponding declaration: bool isTrue(); You also forgot to include the <cstring> header file for strcmp(), while <iomanip> and <cmath> seem to be redundant.
1) Include the <string.h> or <cstring> library (they are the same) for "strcmp" function. 2) Remove the "<char> ime" parameter from your method and it will automatically use class' attribute. And the definition of a method/function "Human::imo" outside the "Human" definition is unnecessary: you have already defined it; it is necessary only if you declared and not defined it.
Am I the only one not getting the input dialog to come up with `cin.getline`? the code isn't asking for input even after the fix.
get You edited your last post. The two sentences you talked about wasn't there when I read it. And please, don't give me stuffs that are not in the OP's code cause that is another story.
get My actual intention was to get the OP to learn and use C++ string in C++ code unless char array was really necessary.
Ipang, "ostream::std::cin.getline" is used to receive string (raw) input with spaces. It is SoloLearn's issue that it does not ask for input in that case. But you can use some "cin >> {declared_but_unused_variable};", which makes no sense to the program, so that Playground will ask for input.
get I know that, but Code Playground doesn't pop the input dialog up where I'm supposedly write a name to test Do you get the input dialog to pop running the OP's code?
Ipang, no. If you did not understand the last two sentences, there is an example: type `string __unused_string__; cin >> __unused_string__` after the "<int> main ()" function for input pop-up to be displayed.