C++ multiline string literal

Well … Sort of. The easiest is to just use the fact that adjacent string literals are concatenated by the compiler: The indentation doesn’t matter, since it’s not inside the quotes. You can also do this, as long as you take care to escape the embedded newline. Failure to do so, like my first answer … Read more

Invalid conversion from ‘char’ to ‘const char *’

You’re trying to pass a char to LoadFileToString which takes in a char*. I think what you intend to do is this Notice that I’m reading the input into a string instead of a char since the LoadFileToString expects a (C-style) string to be passed in; instead you’re reading and trying to pass a character … Read more

Call of overloaded function is ambiguous

The literal 0 has two meanings in C++.On the one hand, it is an integer with the value 0.On the other hand, it is a null-pointer constant. As your setval function can accept either an int or a char*, the compiler can not decide which overload you meant. The easiest solution is to just cast … Read more

ERROR: Control may reach end of non-void function /

If you call the function with a first argument of 0 the loop is never executed and the return statement is, thus, never reached. Falling of the end of a non-void function is undefined behavior. My personal guess is that the return statement was meant to one level up, i.e., in the out block: this would guarantee that the function always returns … Read more

variable or field declared void

It for example happens in this case here: Try using std::string instead of just string (and include the <string> header). C++ Standard library classes are within the namespace std::.

Use of undefined type [duplicate]

In State::State, you are using Core before it is actually defined. You can fix this easily in your example by moving the constructor implementation out of the class definition: It’s much more common in practice to have the implementation of these functions in a separate implementation (.cpp) files, in which case the forward declarations would … Read more