I am currently going through lecture 62 in the Bull Cow game section of the Unreal Engine C++ developer course. I am completely new to coding and can’t seem to wrap my head around some of the concepts being introduced in this section.
During the lecture, there are 2 integers being declared like so:
int32 a = 1; int32 b = a++;
We then plug them into the following function:
PrintLine(TEXT(“%i , %i,”), a, b);
And when we run the Bull Cow game (around the 4 minute mark of the video), we get the values of 2, 1 printed within the game.
So my question is why does this happen?
More specifically, why does the declaration of the second integer appear to override the declaration of the first?
Why is it not 1, 1 instead? (Since we said int32 a = 1)
In other words, why does a become 2?
And what exactly is it within our function that makes it 2 when it gets printed within the Bull Cow game?
I’m confused. Please give me a very dumbed down kindergarten level explanation as to what is going on here.