【问题标题】:typedef struct with second specifier after the name [duplicate]名称后带有第二个说明符的 typedef 结构 [重复]
【发布时间】:2021-10-19 04:29:11
【问题描述】:

我了解,在声明 typedef struct 时,您在大括号后为其命名。在这种情况下为 S_STORE。

但是在下面的例子中 *LPSTORE 是什么意思呢?

typedef struct MySTORE
    {
      WCHAR Name;
      ...
    } S_STORE, *LPSTORE;

【问题讨论】:

标签: c++ struct typedef


【解决方案1】:

这会在一行中创建两个 typedef 别名。

相当于

struct MySTORE { WCHAR Name; ... };
typedef MySTORE S_STORE;
typedef MySTORE *LPSTORE;

typedef 也可以写成:

using S_STORE = MySTORE;
using LPSTORE = MySTORE *;

【讨论】:

    猜你喜欢
    • 2017-10-24
    • 1970-01-01
    • 2022-11-10
    • 2013-07-17
    • 1970-01-01
    • 2021-12-23
    • 2021-07-22
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多