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: >>12 2010-05-30 6:45

>>14
If you want to address bytes, use bytes (char or unsigned char). If you want ints use ints.

Pointer arithmetic is fine as it is. Changing it to only operate on bytes would only make everyone have to add +n*sizeof(...) to their code, which would be stupid. If you like to do everything manually, just use ASM.

I'm really not seeing the problem here, unless you don't know of the char/unsigned char type?

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