c++中typedef和指针的规则是什么

What are the rules to typedef and pointers in c++?

本文关键字:规则 是什么 指针 typedef c++      更新时间:2023-10-16

可能重复:
常量指针的C++typedef解释

我刚刚了解到typedef用指针做一些奇怪的事情

这里有一个例子:

typedef float* fptr;
const fptr f; // This is float * const f instead of const float * (like I wanted)

它为什么这么做?

似乎已经在中回答了

常量指针的C++typedef解释

另请参阅typedef指针是个好主意吗?有关typedef和指针的更多讨论。