ITfeng

 

经典递归程序----反向输出字符串

#include<stdio.h>
void reverse(char*s);
int main()
{
 char *a="hello world";
 reverse(a); 
}
void reverse(char*s)
{
 if(*s=='\0') return ;
 reverse(s+1);
 printf("%c",*s);
}

posted on 2012-05-08 21:34  ITfeng  阅读(160)  评论(0编辑  收藏  举报

导航