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 7:50

>>20
Changing it to only operate on bytes would only make everyone have to add +n*sizeof(...) to their code, which would be stupid.

Thats what arrays are for, it should be like i say with pointers.

A pointer is a just pointer for gods sake. it just points to some location in memory, independend of the size of the object at that address. This behaviour doesnt make much sense.

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