用递归实现字符串的逆序

来源:互联网 发布:linux启动oracle实例 编辑:程序博客网 时间:2024/05/31 19:39
#include<stdio.h>#include<windows.h>void reverse_print(const char *msg){    if(*msg=='\0')    {        return;    }    reverse_print(msg+1);    printf("%c",*msg);}int main(){    const char *str="abcdef1234";    reverse_print(str);    printf("\n");    system("pause");    return 0;}
0 0
原创粉丝点击