#error: control reaches end of non-void function. What does this mean?

11 messages · Page 1 of 1 (latest)

rose echo
#

Usually this means that a return has no value but how would i implement it in here?

faint cloudBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.

rose echo
main heraldBOT
#
Compiler Output
<source>: In function 'Choice convert(char)':
<source>:25:1: warning: control reaches end of non-void function [-Wreturn-type]
   25 | }
      | ^
Welcome to Chin Chan Pu!

Would you like to play in dynamic mode? (Enter 0 for yes, any other number for no): 
Enter r for rock, p for paper, s for scissors, or q to quit: Invalid input. Please try again.

Enter r for rock, p for paper, s for scissors, or q to quit: Invalid input. Please try again.

Enter r for rock, p for paper, s for scissors, or q to quit: Invalid input. Please try again.

Enter r for rock, p for paper, s for scissors, or q to quit: Invalid input. Please try again.

Enter r for rock, p for paper, s for scissors, or q to quit: Invalid input. Please try again.

Enter r for rock, p for paper, s for scissors, or q to quit: Invalid input. Please try again.

Enter r for rock, p for paper, s for scissors, or q to quit: Invalid input. Please try again.

Enter r for rock, p for paper, s for scissors, or q to quit: Invalid input
spiral plume
#

the problem is that the convert function doesn't cover every possible value of char and in some cases may exit the function without returning a value

rose echo
mellow lagoon
rose echo
#

ah so defaulting and then returning so that with an invalid input it defaults to what i choose it to be

rose echo
#

!solved