Nested structures

前端 未结 6 2010
旧时难觅i
旧时难觅i 2020-12-03 08:42

The following code compiles on a C++ compiler.

#include 
int main()
{
    struct xx
    {
        int x;
        struct yy
        {
                    


        
6条回答
  •  猫巷女王i
    2020-12-03 09:02

    Well, cstdio needs to be referred as stdio.h. As for the structure, the struct-keyword is not required in C++.

    You don't really define struct members, but pointer members, so it seems plausible that it should work in either case.

提交回复
热议问题