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

List<T>().Add problem C# -

Javascript natural sort array/object and maintain index association -