Hi, I am working in 64 bit x_86 64 bit OSX system.
I am reading the file of legacy database. It is loaded to a memory block and using offsets it read to the structures. It is written in 32 bit mode.
So in order to read properly in 64 bit mode, I want to add n bytes to the base address of a structure.
Since pointer incement
increment does not help me to do it As it is in 64 bit mode every pointer is b byte long.
Regards, Dhana.
I have posted some code here. I guess it is right..
struct CamNodeTag {
CamNodeTag *nextCam; // next cam
SInt32 numMake;
char *menuMake;
};
long pBaseAddr; // this is long so we an offset bytes from it.
//Get the size of of the structure in 32 bit environment.//in 64 bit envi it is 20 bytes.
int CamNodeTagSizeIn32BitMode = 12;
//Do it in a while loop..
int i=0;
CamNodeTag * pNode = (CamNodeTag *)(pBaseAddr + i*CamNodeTagSizeIn32BitMode);
while(pNode !=NULL)
{
//Do the cam stuff here..
// to get the next node, we add the base addr to the offset
//This will give next cam
i++;
pNode = (CamNodeTag *)(pBaseAddr + i*CamNodeTagSizeIn32BitMode);
}