Hi,
I am trying to initialize the structure like below in c++(-cpp11)struct{int a;int b;}structType;
structType xyz{.a=5, .b=7};
However the above code is giving me error "expected an expression".If I use the -c99 option, the other c++ code give
I believe you have to add "struct" as a keyword before the struct type, so "struct structType xyz{.a=5, .b=7};
Does C++ 11 allow this?
EDIT
It appears not - until C++ 20:
https://en.cppreference.com/w/cpp/language/aggregate_initialization - see "Designated initializers"