K
Keith Thompson
Skybuck Flying said:I just came across something strange.
Prototypes for routines:
1: void test(void *data)
2: void test(void &data)
The first one does compile in visual studio 2010 and the second does not.
They both seem conceptually the same, like untyped variable data in Delphi,
yet the first one is allowed and the second is not allowed.
Isn't that strange ?!
No.
Seems like case 2 is not yet implemented, either in the c/c++ language rules
or in the compiler ?!
The second form appears to be a reference parameter, a feature that
C++ has and C doesn't. C and C++ are two different languages.
If you didn't know that, I suggest that your vague opinion that they
"both seem conceptually the same" isn't worth much.
But if you really want to know why something doesn't compile,
you should post a complete source file along with the actual error
messages.