I declare the following function:
I would like to fill in the values in the structure on a different page/function. The other function will do something like:
I'm thinking I need to pass the address of the structure
in the function. However, I'm getting errors. Can anyone help me with the syntax?
Code:
struct DataElement {
string Fragment;
double FragVal;
int NumFound;
DataElement() // Example of a constructor used in a structure.
{
Fragment = "";
FragVal = 0;
NumFound = 0;
}
} *MetaFrag;
I would like to fill in the values in the structure on a different page/function. The other function will do something like:
Code:
MetaFrag = new DataElement [ 5 ];
MetaFrag[0].Fragment = "CCCCCCC";
MetaFrag[0].FragVal = -0.19;
MetaFrag[0].NumFound = 0;
MetaFrag[1].Fragment = "CCCCCC";
MetaFrag[1].FragVal = -0.16;
MetaFrag[1].NumFound = 0;
etc..
I'm thinking I need to pass the address of the structure
in the function. However, I'm getting errors. Can anyone help me with the syntax?