void*指针移动
请问如果我声明了一个void*类型的指针变量,现在想把它移动四个字节的位置上赋值size大家觉得一下两种方法正确吗?
// assign size to the exact position
*((int*)p + 1) = size;
*(int*)(p+4) = size;
2008-10-24 22:02
2008-10-25 00:03

2008-10-25 12:21
2008-10-25 17:04

2008-10-25 23:57