I have a long C (not C++) struct. It is used to control entities in a game, with position, some behavior data, nothing flashy, except for two strings. The struct is global.
Right now, whenever an object is initialized, I put all the values to defaults, one by one
myobjects[index].angle = 0; myobjects[index].speed = 0;
like that. It doesn't really feel slow, but I am wondering if copying a "template" struct with all values set to the defaults is faster or more convenient.
So, to sum up into two proper questions: Is it faster to copy a struct instead of manually setting all the data? What should I keep in mind about the malloc-ed memory for the strings?