Re: how can I puts a char array reserve by recursion algoritym?



"emre esirik(hacettepe computer science and engineering)"
<emreesirik@xxxxxxxxx> a écrit dans le message de news:
17651794-5cfe-490a-9780-0107dee5e579@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
int i=0;
char word[50];
printf("enter the word");
scanf("%s",word);
reserve(word,i);

void reserve(char word[], int i)
{
if(word[i]!='\0')
{
reserve(&word[i+1],i+1);
printf("%c",word[i+1]);
}
}

Try harder! You are off by one on about every line ;-)
I have reversations with your choice of algorithm.

--
Chqrlie.


.



Relevant Pages