【发布时间】:2012-02-28 05:23:27
【问题描述】:
我有以下结构
typedef struct _LSHFunctionT
{
double *a;
double b;
} LSHFunctionT, *PLSHFunctionT;
我的问题是;这两个声明有区别吗
PLSHFunctionT myPointer1;
和
LSHFunctionT *myPointer2;
如果不是,那为什么人们要明确使用其中的两个(LSHFunctionT 和 *PLSHFunctionT)。为什么不直接使用 LSHFunctionT。
下面的两个声明是不是也一样
PLSHFunctionT *myPointer3;
和
LSHFunctionT **myPointer3;
【问题讨论】:
-
对于你的问题“为什么人们明确使用它们中的两个(LSHFunctionT 和 *PLSHFunctionT)”,我认为有些人只是觉得写
Pwhatever ptr比写whatever* ptr更“干净”,因为他们不喜欢星号之类的。 ::耸肩::