一段单词反转的函数

来源:互联网 发布:城市电话区号查询软件 编辑:程序博客网 时间:2024/04/30 12:59

一段单词反转的函数

i am a student  ---------->> student a am i

void reverse_str(const char *pSource, char *pDest){    char *p  = pSource;    char *pBlank = " ";    while(*p && 0x20 != *p)        p++;    if (*p)    {        reverse_str(p+1, pDest);    }    strncat(pDest, pSource, p-pSource);    strcat(pDest, pBlank);}
	
				
		
原创粉丝点击