由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - One question about Void pointer
相关主题
请问可以这样定义struct吗?sizeof()的问题
Questions about c code请教函数 INIT 怎么能free memory
用c怎么实现generic stack (转载)difference between FILE and struct FILE
pointer to function[合集] Interview Question
Java questionask a question about struct in C programming
Need help on C++ codetypedef
how to initialize this struct.typedef struct的问题
为啥有人喜欢把_s结尾的结构typedef成_t结尾的,有讲究么?一个简单的C编程问题
相关话题的讨论汇总
话题: uint16话题: void话题: pointer话题: struct话题: byte
进入Programming版参与讨论
1 (共1页)
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.

1 (共1页)
进入Programming版参与讨论
相关主题
一个简单的C编程问题Java question
有段c++代码看不懂Need help on C++ code
请教一个c++ 里functor的问题how to initialize this struct.
问个编程,系统,网络有关的综合问题。为啥有人喜欢把_s结尾的结构typedef成_t结尾的,有讲究么?
请问可以这样定义struct吗?sizeof()的问题
Questions about c code请教函数 INIT 怎么能free memory
用c怎么实现generic stack (转载)difference between FILE and struct FILE
pointer to function[合集] Interview Question
相关话题的讨论汇总
话题: uint16话题: void话题: pointer话题: struct话题: byte