Thread: Basic recursion question

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Jan 2011
    Posts
    34
    Quote Originally Posted by homer_3 View Post
    Really? You read that tutorial and this part didn't help at all

    Code:
    void count_to_ten ( int count )
    {
        /* we only keep counting if we have a value less than ten
           if ( count < 10 )   
           {
               count_to_ten( count + 1 );
           }
    }
    int main()
    {
      count_to_ten ( 0 ); 
    }
    Yes what does
    Code:
    void count_to_ten ( int count )
    even mean?

  2. #2
    Registered User
    Join Date
    Nov 2010
    Location
    Long Beach, CA
    Posts
    5,909
    Quote Originally Posted by benrogers View Post
    Yes what does
    Code:
    void count_to_ten ( int count )
    even mean?
    If you don't know what that means, then you're not ready for recursion yet. Sorry, but you must have a good understanding of functions before you can do recusion. Read some function tutorials: Cprogramming.com Tutorial: Functions. Search the web for more. Master functions, then work on recursion.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Visual Basic question
    By voodoo3182 in forum Windows Programming
    Replies: 11
    Last Post: 09-12-2005, 07:40 PM
  2. Basic string question
    By charbach007 in forum C++ Programming
    Replies: 2
    Last Post: 03-24-2005, 12:41 PM
  3. A very basic question
    By AshFooYoung in forum C Programming
    Replies: 8
    Last Post: 10-07-2001, 03:37 PM