I'm just beginning to learn C++ through my university course.
I'm revising for a C++ exam and I was hoping I could just ask some simple questions about things I'm not so sure on.
First of all, if I have this:
int i = 4;
What is the difference between these two lines:
int* p = &i;
int& r = i;
By my understanding, at this point both p and r are like conduits to i; changing their value will change the value of i...
Secondly, about assembly, I have a question in a past exam that is fooling me:
mov eax, dword ptr[b]
push eax
mov eax, dword ptr[a]
push eax
call printCode (411186h)
add esp,8
Q: Which of the following prototypes when dissassembled, best match the assembly code?
A: int printCode(int a, int b)
My question is: If the assembly is moving ptr[a] and ptr[b]... Why is the prototype not int* a, int* b?
Thank you.