Thread: Please check my work...

  1. #31
    C++ Newbie
    Join Date
    Nov 2005
    Hey quzah, I've been reading your post from the previous page about the return statement inside void functions. Well, what if you were to break out of a void function? Shouldn't the return statement be included in all function for the sake of consistency?
    void something(int value1, int value2) {
      if(value1 > value2) {
      std::cout << "The answer is : " << value1 + value2";
    Then again... I don't like using abort() or exit()...

  2. #32
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    You can return early from a void function. It isn't however a requirement. That was the question.

    Hope is the first step on the road to disappointment.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. BN_CLICKED, change button style
    By bennyandthejets in forum Windows Programming
    Replies: 13
    Last Post: 07-05-2010, 11:42 PM
  2. Code doesn't work: Check alphabetical order
    By motozarkov in forum C++ Programming
    Replies: 5
    Last Post: 04-27-2005, 02:53 PM
  3. Shouldn't this code work?
    By DeepFyre in forum C++ Programming
    Replies: 3
    Last Post: 10-03-2004, 01:24 PM
  4. If you are employed as a programmer, please look
    By Flood Fighter in forum A Brief History of
    Replies: 10
    Last Post: 09-28-2004, 02:35 AM
  5. writing/reading from file produces double results.
    By stumon in forum C Programming
    Replies: 4
    Last Post: 03-20-2003, 04:01 PM