its a simple Celsius to Fahrenhiet (and vice versa) converter. When I compile it, CodeBlocks keeps giving me the following warning:
int f2c(): control reaches end of non-void function
int c2f(): control reaches end of non-void function
what does it mean? and if there is anything wrong that I havent noticed, please point it out.
If choice is 1, then an integer is not returned. To resolve this, you can either change your methods' returns to void or do something similar to this in order to make the warning go away.
1 2 3 4 5 6 7
/// I think this is what you want to do.
if (choice == 1) /// If the user enters 1, then make another calculation
{
dialouge();
}
/// If not, return
return 0;
-Edit- You seem to be using recursion in this program, if you're unfamiliar with the term, Wikipedia has a nice article on it. http://en.wikipedia.org/wiki/Recursion_%28computer_science%29
// Warning: Not all control paths return a value
int func(int choice) // This function will return an integer value
{
if(choice == 1)
{
return 1; // If choice is not 1, then this code is never executed and the function will not return an int
}
}
/// No warnings - all control paths return a value
int func2(int choice)
{
if(choice == 1)
{
return 1; // If choice is 1, then 1 is returned
}
return 0; //If choice is not 1, then 0 is returned, so every possible control path returns something
}