Unreal C++ Bulls and Cows, Lecture25: Solving the challenge with an if statement

Insted of returning the input itself, I created an if statement thet returns true if the first letter of input is ‘y’ or ‘Y’ and otherwise returns false. Are there any risks or possible side effects of this soluction to the challenge. I am very unexperienced, the Unreal course being my first way to learn coding.

It’s the same thing it’s just slightly redundant. Let me rephrase what you have written to showcase it

if (true)
    return true;
else //false
    return false;

So you’re effectively saying return what the value already is so you could just return the expression itself. Also to be coding to Unreal’s coding standards the naming should be PascalCase not UPPERCASE

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms