[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Difference between for and while loop



On Fri, Apr 18, 2003 at 04:40:00PM +0300, Aryan Ameri wrote:
> Newbish question, what's recursion ?

A function calling itself.
Here is a C example for printing out a number :

void printDigits(int number)
{
   if(number>0)
   {
      printDigits(number/10);
      putchar(0x30 + number % 10);
   }
}

int main(int argc,char **argv)
{
   printDigits(12345);
}

Frank

> Cheers
> 
> -- 
> /* Impeach God */
> 			--RMS
> Aryan Ameri
> 
> 
> -- 
> To UNSUBSCRIBE, email to debian-user-request@lists.debian.org 
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org



Reply to: