Hi, i'm with a problem here that i can't understand what it is.
Hi have this code
basically i am trying to declare a std::string object in a struct to later fill it with information
the next step i allocate an array of SF structs and try to do it
the ushort type i can acess, the std::string generates a segmentation fault error, and i can't understant why. Does anyone know what i am doing wrong?
PS- sorry for the bad english.
Hi have this code
Code:
struct SF {
std::string mnemonic;//mnemonic that represents it
std::string name;//a descriptive name
ushort num_val1;// number of the first value
uchar possiblevalues_num; //number of the possible values.
uchar type; /* = 1 if the feature is utilized in the models*/
};
the next step i allocate an array of SF structs and try to do it
Code:
SF * FTab;
FTab = (SF *) calloc(6, sizeof(SF));
FTab[0].num_val1 = (ushort) 5;
FTab[0].mnemonic("xpto");
PS- sorry for the bad english.
Comment