I guess I am a bit puzzled by the syntax. What does the following mean?
typedef char *PChar;
hopeItWorks = PChar( 0x00ff0000 );
I guess I am a bit puzzled by the syntax. What does the following mean?
typedef char *PChar;
hopeItWorks = PChar( 0x00ff0000 );
It is equivalent to (PChar) 0x00ff0000
or (char *) 0x00ff0000
. Syntactically think of it as invoking a one-argument constructor.
SomeType(args)
means explicit constructor call if SomeType
is user-defined type and usual c-cast (SomeType)args
if SomeType
is fundamental type or a pointer.
PChar
is equivalent to char *
(pointer). Thus hopeItWorks = (char *)0x00ff0000;
typedef char *PChar;
Its typedef of char*
to Pchar
. Instead of using char*
you can define variables with Pchar.
hopeItWorks = PChar( 0x00ff0000 );
Its equivalent to ==>
hopeItWorks = (char *)( 0x00ff0000 );