
void myswap(char *a, char *b)
{
*a = (*a)^(*b);
*b = (*a)^(*b);
*a = (*a)^(*b);
}
void reverseString(char* s, int sSize)
{
for (int i = 0; i < (sSize >> 1); i++) {
myswap(&(s[i]), &(s[sSize -1 -i]));
}
}
void myswap(char *a, char *b)
{
*a = (*a)^(*b);
*b = (*a)^(*b);
*a = (*a)^(*b);
}
void reverseString(char* s, int sSize)
{
for (int i = 0; i < (sSize >> 1); i++) {
myswap(&(s[i]), &(s[sSize -1 -i]));
}
}
本文标题:字符串处理
本文链接:https://www.haomeiwen.com/subject/sfrdmctx.html
网友评论