#include<iostream>
#include<string>
using namespace std;
void ReverseString(char *p, int from, int to)
{
while (from < to)
{
char temp = p[from];
p[from++] = p[to];
p[to--] = temp;
}
cout << p;
}
int main()
{
char q[] = "I am a student.";
char *p = q;
cout << *(p + 3);
ReverseString(p,0,14);
}
思考:
1.反转字符串的思想
2.字符串数组、指针