Initializing a structure in c++ -


g++ 4.4.3

i have following structure api guide:

typedef struct network_info {     int network_id;     int count; } network_info, *network_info; 

and in source code doing this:

network_info net_info = {}; 

is 2 curly braces initializing object of structure? initialize values to?

many advice,

this default-initialize fields of variable net_info - set them both zero. that's handy one-liner used initialize structs don't have user-defined constructor instead of using memset().


Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -