Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

shitty C pointer arithmetic

Name: Anonymous 2010-05-29 14:38

Why are pointers in C aligned to the size of their data? Why cant they just reference memory bytewise?

How can i manipulate a pointer so that it references a address not by its own size, without typecasting it?

Name: Anonymous 2010-05-30 4:58

>>12
I want to do something like this:


int *mem = malloc(10);
int shit = 0;
*(mem + 1) = shit; /* should be mem+1 and not mem+1*sizeof(int) so that i have shit in *(mem + 1) to *(mem + 5) */

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List