double test; test = pTile->GetX;
Trace ("X Coord: %.2f, Y Coord: %.2f, Style: %d",pTile->GetX , pTile->GetY, pTile->iStyle);
double test; test = pTile->GetX;
Trace ("X Coord: %.2f, Y Coord: %.2f, Style: %d",pTile->GetX , pTile->GetY, pTile->iStyle);
quote:
Original post by tifkagh
Cheers Fruny,
since we are on the topic of the meaning pointers in relation to classes/objects perhaps you could clear up another fuzzy area in my thinking.
If I declare a pointer:
MyObj* pExample
I''m essentially creating a 4 byte area to hold the address of a proposed, but not yet existing, object of type MyObj. This area will be set to all zeros commonly referred to as Null. (Y/N)?
Now, suppose it''s time to instantiate the object, which I do using:
pExample = new MyObj
A new block of memory is allocated by the compiler. The new block of memory will contain only the data members. All the functions, and statics for that matter, for a given class are stored once and once only, presumably at the start of the executable. (Y/N)?
quote:
Original post by Fruny
As Nazrix correctly points out, no pointers are not automatically zeroed, and yes, new will allocate memory and call the constructor, if any.
This topic has been locked by a moderator. New replies are not allowed.
With your permission, GameDev.net uses analytics cookies to understand how people use the platform. You can accept analytics or continue with necessary cookies only. Learn more