Timewarp
5th February 2006, 01:22
Hi,
I'm a bit confused at the moment. I've got a struct with about 30 elements of different types.
Most of them are regular C/C++ variables and a few of them are QStrings. Now when I try to memset my instance of the struct my program crashes.
something like this
memset(&mystruct, 0x00, sizeof(mystruct));
I noticed that QStrings seem not to like this and cause the crash. The question now is:
What is the appropriate way to initialize my struct ? listing all members and assign them values by hand seems not very handy. Or is there something like qMemset ?
I'm a bit confused at the moment. I've got a struct with about 30 elements of different types.
Most of them are regular C/C++ variables and a few of them are QStrings. Now when I try to memset my instance of the struct my program crashes.
something like this
memset(&mystruct, 0x00, sizeof(mystruct));
I noticed that QStrings seem not to like this and cause the crash. The question now is:
What is the appropriate way to initialize my struct ? listing all members and assign them values by hand seems not very handy. Or is there something like qMemset ?