Thread: switch{}

  1. #1
    Registered User Draco's Avatar
    Join Date
    Apr 2002


    if I use return() inside a switch statement, will I return out of the function that the switch is in, or will I only exit the switch statement?

  2. #2
    Registered User Sargnagel's Avatar
    Join Date
    Aug 2002
    The keyword return causes program flow to exit from the current function and return to the calling function.
    If you want to exit the switch statement only, you can use break.
    Last edited by Sargnagel; 05-04-2003 at 10:13 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Data Structure Eror
    By prominababy in forum C Programming
    Replies: 3
    Last Post: 01-06-2009, 09:35 AM
  2. ascii rpg help
    By aaron11193 in forum C Programming
    Replies: 18
    Last Post: 10-29-2006, 01:45 AM
  3. Switch
    By cogeek in forum C Programming
    Replies: 4
    Last Post: 12-23-2004, 06:40 PM
  4. Switch Case
    By FromHolland in forum C++ Programming
    Replies: 7
    Last Post: 06-13-2003, 03:51 AM