I am running QNX 4.25 with the Watcom 10.6 compiler. I am using the 32
bit flat memory compiler option. This is what I am trying to do:
#include <stdio.h>
#include <stdlib.h>
typedef unsigned int ArrayType[8][8][8][32][512];
void main (void)
{
ArrayType *Array;
Array = (ArrayType *)malloc(sizeof(ArrayType));
}
When I access Array[0][0][0][0][1] it’s memory address is 0xC9C8;
When I access Array[0][0][0][0][2] it’s memory address is 0xCDC8;
I expected the next element to be at memory location 0xC9CA. (sizeof
(unsigned int) == 2).
Can anyone explain how the QNX/Watcom Compiler processes multi
dimensional arrays within memory?
Thanks for the help.
Sent via Deja.com http://www.deja.com/
Before you buy.