Memory aligment

numnum (numnum)
. It's safe to do the implicit conversion for values, because you only make a memory copy. Imagine you explicitly cast a
char* into int*, what will happen? You will end up with a bus error on
Unix, although you are fine on PC because PC's are running little endian
chips. int data access requires an alignment of 4 on UNIX but your char* pointer might very likely be pointing to some odd numbered memory address.

2001-6-21 -04:00

回到话题: show u another dark spot of c

回到论坛: HOME枫下论坛枫下论坛主坛工作学习IT技术讨论