Lecture 21 Challenge | Linux + CLion results and unexpected errors solution

Hello everyone, so I ran into a small unexpected error from attempting this challenge and I was able to solve it using a little research.


This was the code I had placed into CLion expecting to work flawlessly as everything made sense to me that it would request an input and respond with the input through cout.

The issue here, and this could just be CLion, is that it gives a redundant string initialization error and by doing a quick google search I was able to find out why.

Basically string Guess = " "; is redundant. By applying " " you are saying that the string Guess is not defined.
While this is pretty clear to us, CLion unfortunately wants to make the code look more clean and redundancy isn’t always useful (looking at you databases.)

By removing ’ = " " ’ this error will disappear and you will be able to continue on with the rest of the code.

It looks like this for me:

I hope this helps!

Privacy & Terms