int _tmain(int argc, _TCHAR* argv[])
{
char mark[] = "I am Mark BB";
int len = sizeof(mark) / sizeof(char) - 1 ;
printf("length = %d\n", len);
for (int i = 0; i < len/2; i++)
{
char tmp = mark[len - i - 1 ];
mark[len - i - 1] = mark[i];
mark[i] = tmp;
}
for (int i = 0; i <= len; i++)
printf("mark[%d] = %c\n", i,mark[i]);
}
No comments:
Post a Comment