Original Post
Hi.
I am trying to understand this bit of code an one thing is unclear for me.
unsigned char *arr; arr = new unsigned char[6]; int var; // int is 4 bytes // unsigned char *tmp = arr; tmp += sizeof(var); // increment arr byte array by 4 bytes. sizeof(int) // the pointer now is pointing at position 4 ie. arr[3] int a = int(arr); // What is this value ----> 114633960 Why so big? int b = int(tmp); // and this value ----> 114633964 int incrementedby = int(tmp-arr); // incrementedby = 4 which is ok as I incremented by four bytesOk. Now what exactly int(arr) does. It looks to me as its does some kind of casting doesnt it? But why those big numers? Why this is different resutl int result = int(tmp-arr); than this int result = int(tmp) - int(arr); [edited by - papa on May 12, 2004 8:04:41 AM]