All- I've researched this quite a bit. My program compiles without error, but the values from the functions within the struct are not passing to the program. Can you help me to figure out why they are not? I included the snippets of code that show the components in question. Mainly, my code like: "&allData::ConvertToC" is not returning any value from the function within the struct allData. It only will return a value of 1, no matter the input of allData.temperature.
cout << "Enter C for converting your temperature to Celsius, or enter F for converting your temperature to Fahrenheit, and press ENTER." << endl << endl;
cin >> allData.selection;
cout << "Enter your starting temperature to two decimal places, and press ENTER." << endl << endl;
cin >> allData.temperature;
switch (allData.selection) {
case 'c': { &allData::ConvertToC;
cout << "Your temperature converted to Celsius is: " << &allData::ConvertToC << endl << endl;
break;
}
case 'C': { &allData::ConvertToC;
cout << "Your temperature converted to Celsius is: " << &allData::ConvertToC << endl << endl;
Apologies, in creating code snippets for my post (to post more concisely) I removed my definintion of allData.selection from the post but not my program. However, it is contained within the struct definition with all of the other variables (see below). Additionally, I tested your theory on naming the struct variable in visual studio and found that the name of the struct variable is fine.