*Author : DavidLin *Date : 2014-12-15pm *Email : [email protected] or [email protected] *world : the city of SZ, in China *Ver : 000.000.001 *For : reverse the char array/string! *history : editor time do * 1)LinPeng 2014-12-15 created this file! * 2) */ char * reverse(char * buf) { int len; char tmp; int i; if(NULL == buf) { return NULL; } len = strlen(buf); for(i = 0; i < len/2; i++) { tmp = buf[i]; buf[i] = buf[len -i -1]; buf[len -i -1] = tmp; } return buf; }
时间: 2024-10-24 22:58:20