I'm having a little bit of confusion understanding structures. So a few questions.
1.
1 2 3 4 5 6
struct name
{
int a = 0;
int b = 0;
int c = 0;
} base10[];
Is this uniform initialization? If so is it possible to declare a struct using other types of initialization? My pathetic attempt yielded a compiler error but I don't necessarily understand why.
The reason I'm asking is because the above code looks very similar to say...
No it is a struct with default values assigned to its member.
And base10 would be an array of name's if you provide size of it. It is equivalent ot:
1 2 3 4 5 6 7
struct name
{
int a = 0;
int b = 0;
int c = 0;
};
name base10[...];
The reason I'm asking is because the above code looks very similar to say...
Nope. Curly braces here are not denotes brace-enclosed initializer list here. They are here to show that everyhing inside belongs to name struct. They are like block denoting braces in functions and loops.