s********k 发帖数: 6180 | 1 Is it risk to use void pointer in the following case:
typedef struct
{
void *next;
UINT16 xx;
UINT16 yy;
byte zz;
} a;
mostly, I think
struct a
{
struct a *next;
UINT16 xx;
UINT16 yy;
byte zz;
};
could be better, but is there any risk to use void pointer? what we should
pay attention in order to carefully manipulate the pointer in this case?
thanks |
s****n 发帖数: 786 | 2 第二个没问题,但是写法不对,void point没必要。
【在 s********k 的大作中提到】 : Is it risk to use void pointer in the following case: : typedef struct : { : void *next; : UINT16 xx; : UINT16 yy; : byte zz; : } a; : mostly, I think : struct a
|
s********k 发帖数: 6180 | 3 what's wrong with second one? I know void pointer dose not make sense in
this example, just some legacy code.
【在 s****n 的大作中提到】 : 第二个没问题,但是写法不对,void point没必要。
|
s****n 发帖数: 786 | 4 你写成这样就好了
typedef struct _a
{
struct _a *next;
UINT16 xx;
UINT16 yy;
byte zz;
}a;
【在 s********k 的大作中提到】 : what's wrong with second one? I know void pointer dose not make sense in : this example, just some legacy code.
|