wondering how i could reset a specific struct in an array to just default values? I know I can just do each individual value for the struct to 0, but i feel like that's ineffecient.
memset
If you consider 0 the default value, use memset(struct_pointer, 0, sizeof(struct)).
How is that not efficient? And what do you mean by default values. Unless initialized elements of the array has random values.
Обсуждают сегодня