If you want to make it clear what each initializer value is, just split it up on multiple lines, with a comment on each:
address temp_addres = {
0, // street_no
nullptr, // street_name
"Hamilton", // city
"Ontario", // prov
nullptr, // postal_code
};
More Related Contents:
- memset() or value initialization to zero out a struct?
- too many initializers for ‘int [0]’ c++
- How to initialize a struct to 0 in C++
- Structure size so big, need optimization
- can’t extract data from a structure array c++ [closed]
- Initialization of all elements of an array to one default value in C++?
- In this specific case, is there a difference between using a member initializer list and assigning values in a constructor?
- C++ static member variable and its initialization
- What does C++ struct syntax “a : b” mean
- “error: assignment to expression with array type error” when I assign a struct field (C)
- initialize a const array in a class initializer in C++
- Why is initialization of a new variable by itself valid? [duplicate]
- Why can I not brace initialize a struct derived from another struct?
- How to convert string to IP address and vice versa
- Why can’t we initialize members inside a structure?
- How can I make `new[]` default-initialize the array of primitive types?
- How to do the equivalent of memset(this, …) without clobbering the vtbl?
- When extending a padded struct, why can’t extra fields be placed in the tail padding?
- How are local and global variables initialized by default?
- Struct Constructor in C++?
- initialization: parenthesis vs. equals sign [duplicate]
- Can a C++ compiler re-order elements in a struct
- What’s the difference between parentheses and braces in c++ when constructing objects
- How to initialize a pointer to a struct in C?
- How can I use a custom type as key for a map in C++?
- Default and value initialization of POD types in C++
- What is the meaning of double curly braces initializing a C-struct?
- Fun with uninitialized variables and compiler (GCC)
- No == operator found while comparing structs in C++
- What’s the motivation behind having copy and direct initialization behave differently?