I'm clearly doing something wrong or forgetting something. I have defined a structure in a header file with four variables. I then assign values to those variables in a function located in a different .cpp then I try and take the new values from the structure and assign to different variable in another function. Problem is, I'm able to assign values to the variables in the structure but when I try and transfer those values to other variables they become something like -858993460(this is according to the debugger and watching the threads). How do I fix this?
Structure Defined with it's function(even though not it's not currently be used)
struct Setting {
int Max;
int Min;
int Sample;
int Points;
} Set1, Set2;
** Assigning Values to Structure variables**
void Settings::OnBnClickSet() {
GetDlgItemText(ID_Points,str4);
CW2A buf3((LPCWSTR)str4);
Serial Value;
Value.Set1.Points = atoi(buf3);
}
Attempting to transfer those values to another variable
bool Serial::Temperature(CString) {
int Max,Min,SampleTime,Points;
Max = Set1.Max;
Min = Set1.Min;
SampleTime = Set1.Sample;
Points = Set1.Points;
}