使用指针的算术操作遍历C风格字符串

2014-11-23 23:11:37 · 作者: · 浏览: 5
const char *cp = "steven";
while (*cp)
{
cout << *cp;
++cp;
}