[英]Typedef struct use in c
struct pointsto_val_def
{
unsigned int lhs;
bitmap rhs;
struct pointsto_val_def *next;
};
typedef struct pointsto_val_def *pointsto_val;
typedef pointsto_val *pointsto_val_hash;
Can the last two statements be simply replaced by this one statement? 可以将最后两个语句简单地替换为一个语句吗?
typedef struct pointsto_val_def *pointsto_val_hash
Thanks in advance. 提前致谢。 Cheers.
干杯。
我认为答案是否定的,因为pointsto_val_hash的类型是struct pointsto_val_def**
,这意味着pointsto_val_hash是一个指向struct pointsto_val_def*
的指针,而您的替换是一个指向struct pointsto_val_def
的指针,它们是不相同的。
如果不需要_val
类型,可以用一个typedef
代替它,但是可以使用双指针:
typedef struct pointsto_val_def** pointsto_val_hash;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.