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

unexpected type error

The problem is here: The left-hand-side is a value. Not a variable. That’s why you can’t to a += to it. Although it defeats the purpose of learning how do it the hard way, you can do it like this:

How do you implement a class in C?

That depends on the exact “object-oriented” feature-set you want to have. If you need stuff like overloading and/or virtual methods, you probably need to include function pointers in structures: This would let you implement a class, by “inheriting” the base class, and implementing a suitable function: This of course requires you to also implement a … Read more