I was reading about the difference of the following:
1)
std::string test = level > 10 ? "Master" : "Beginner";
2)
std::string test;
if (level > 10)
test = "Master";
else
test = "Beginner";
And in the second case I was told that in the second option a temporary value is being create which I don't understand.
I learnt that when we declare a variable without initialisation it takes garbage, so the compiler just holds a memory location and doesn't "work" to change its value.