[C++] How to create this 'obstacle' string?

I have also asked Udacity for help.

You probably want to use the ascii value of the character.

Also, if State::kObstacle is an object, you can’t really use switch-case on it. switch-case in most languages only works on primitive data types like strings and numbers, not complex data types. Well strings aren’t primitive in C++, but hopefully you get the point.

Also you can post code directly to the forum to make it easier to read. Screenshots aren’t always easy to read from.

1 Like