Thread: Easy Recursive Question

  1. #1
    Registered User
    Join Date
    Feb 2006
    Posts
    27

    Easy Recursive Question

    I am trying to print out is ascending order instead of descending order. Here is my code

    Here is some sample output

    How many boxes do you see? 4

    Now opening box .4
    Now opening box .4.3
    Now opening box .4.3.2
    Now opening box .4.3.2.1
    How many boxes do you see?


    How can I get it to go 1.2.3.4???

    Thanks in advance
    Last edited by noodle24; 11-02-2006 at 12:35 PM.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    recurse
    print something

    vs.

    print something
    recurse


    Also, why is your recurs function returning a value when it is mostly being ignore?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Recursive question
    By Hoser83 in forum C Programming
    Replies: 3
    Last Post: 02-09-2006, 02:13 PM
  2. This is hopefully an extremely easy question...
    By rachaelvictoria in forum C Programming
    Replies: 2
    Last Post: 11-07-2005, 01:36 AM
  3. 4 easy question
    By Zeratulsdomain in forum C++ Programming
    Replies: 2
    Last Post: 10-15-2005, 10:43 PM
  4. Easy Question
    By Unregistered in forum C++ Programming
    Replies: 2
    Last Post: 08-12-2002, 12:19 PM
  5. I have a 2 easy question about some homework?
    By correlcj in forum C Programming
    Replies: 3
    Last Post: 07-18-2002, 07:28 PM