《C和指针》——6.3
题目:
编写一个函数,把参数字符串中的字符反向排列。
函数原型:
void reverse_string(char *string);
要求:
使用指针而不是数组下标
不要使用任何C函数库中用于操纵字符串的函数
不要声明一个局部数组来临时存储参数字符串
解答代码:
#include <stdio.h> void reverse_string(char *string) { int i, n=0; while (*(string+n) != '