











Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
A part of a windows programming lecture series on docsity.com. It covers the concept of pointers, memory model, pointer declaration, pointer arithmetic, and pointer arithmetic with type casting. How every byte in ram has an address, the difference between older and modern computers in terms of address bus, and the flat memory model in win32 programming.
Typology: Slides
1 / 19
This page cannot be seen from the preview
Don't miss anything!












Pointers
flat memory model in 32-bit environment
*int i = 20; int ptr = &i;
Address of i (&i)
20
variable
Constant or literal ptr i pointer (^) points to
pointer to int
207 208 209 210 211 212 213
( * ) Indirection / De_referencing
( & ) Address / Reference
*double d, ptr_d;
*char c, ptr_c;
ptr_d = &d;
ptr_c = &c;
ptr_d = ptr_d + 1; // Skips 8 bytes in memory
ptr_c = ptr_c +1; // Skips 1 byte in memory
int m, *ptr; ptr=&m;
270
274
270
270
271
271 272 273 274
272 273 274
ptr=pt + 1;
ptr
ptr
In Win32 programming int and long are of
same size (4 bytes)
=4,29,49,67, =0xffffffff
Which bytes are modified? *long double i, ptr; ptr = &i;
***((char ) ((long ) ptr+1)+2) = 91;
***((short int )((long )ptr+2)-1)=91;