I'm stuck at a part of the tutorial. Here is the code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#include <iostream>
usingnamespace std;
class CDummy {
public:
int isitme (CDummy& param);
};
int CDummy::isitme (CDummy& param)
{
if (¶m == this) returntrue;
elsereturnfalse;
}
int main () {
CDummy a;
CDummy* b = &a;
if ( b->isitme(a) )
cout << "yes, &a is b";
return 0;
}
What I do not understand is, what does "CDummy& param" in the functions parameters exactly mean? The part which confuses me is the "&" sign. Can someone comment the important parts in the steps and say what these lines do?
Ah yes, I forgot about that. The entire code makes now sense. Is it correct to say that instead of writing "b->isitme(a)" I could write "a.isitme(a)" ?