Purpose of struct, typedef struct, in C++

前端 未结 6 719
失恋的感觉
失恋的感觉 2020-12-03 05:43

In C++ it is possible to create a struct:

struct MyStruct
{
    ...
}

And also possible to do the following:

typedef struct         


        
6条回答
  •  时光说笑
    2020-12-03 06:28

    The latter is there for compatibility with C - use the first in new C++ code.

提交回复
热议问题