struct PidStruct {
string KeywordValues[NUM_OF_KEYWORD - 14]; //only need the first eight keywords
string HwInfo[MAX_HID][NUM_OF_KEYWORD];
unsignedshort HwCount;
}; //end of struct for the program identifier
where the two string arrays store independant values from one another. Later In my program I parse through a file to locate these and store them into their respective arrays.
however it seems like whenever i write to PID.HwInfo[X][8 or 9] for any value X under 256, it will also write the value into PID.KeywordValues[16 or 17] where the '8' value directly correlates to the '16' value.
ie, PID.HwInfo[X][8] = "Hello";
will also cause: cout << PID.KeywordValues[16] << endl; to result in "Hello"
the opposite is also true where I can write PID.KeywordValues[16] = "Welcome" ;
will also cause cout << PID.HwInfo[X][8] << endl; to result in "Welcome" as well.
Also when I tried to move the order of the variables around in my structure that it would still corrupt but just to other locations. I'm assuming that for some reason I'm getting data corruption for some reason but I'm not quite sure why. any ideas?