I imagine one big thing will be syntax. For my early classes, part of the tests were to note every syntax error in a piece of code.
For data types, I would be familiar with the size of each one, as well as the
sizeof
function. You want to know which the types are signed, and possibly the min/max of that type. The max of a
unsigned char
is: 255 = 2^8 - 1. The number 8 comes from the amount of bits in an
unsigned char
.
if/else and loops you will just have to know how they work, as well as their syntax.
cin is an input stream buffer and cout is an output stream buffer. Thats all we had to memorize for our first test.
I imagine you might get something like this:
1 2 3 4 5 6 7
|
int i = 0;
while (i < 24)
{
if (i % 2 == 0)
cout << i << endl;
i += 3;
}
|
And then be asked what gets printed to the screen.
Edit, or maybe if your teacher is tricky
1 2 3 4 5 6 7
|
int i = 0;
while (i < 24)
{
if (i % 2 == 0);
cout << i << endl;
i += 3;
}
|