the following program is supposed to take an input to choose to convert from F to C or C to F. The problem i am having right now is that it is telling me that no function exists for FtoC or CtoF and as you can see below, the function clearly exists. I use Visual Studio in class but have to use xcode at home as I have a Mac and there seems to be a few differences when programming ( I think, i am probably a moron but this is killing me). I need help fixing this and my prof is out to lunch. any help would be greatly appreciated.
Do these things and it should work:
1.In your CtoF() function, add 'return Fahr;' at the end of the function.
2.In your FtoC() function, add 'return Celcius;' at the end of the function.
3.In your main() function, add 'float Fahr = ' at the beginning of the line where you wrote 'CtoF(Fahr)'.
4.In your main() function, add 'float Celcius = ' at the beginning of the line where you wrote 'FtoC(Celcius)'.
1. it gives an error "cannot return value for void function"
2. same as 1
3. it gives the error "cannot initialize a variable of type 'float' with an rvalue of type void
4. same
Thanks for the help but I have to turn this in. I did finally get it to compile, problem is it is giving all 0's for temps can't figure that one out either.
Do NOT use global variables. Either pass values by reference, create a data type function beside void, or both. Refrain from using any global variables unless absolutely necessary.