字符串以0为结束标志

1     char pp[100];
2     char *kl = pp;
3     strcpy(kl,"23456");
4     kl += 7;
5     strcpy(kl,"abcde");      //this will not show,because 0 is before them
6     cout << pp << "33" << endl;
7     //cout << pp+7 << "33" << endl;

 

posted @ 2016-09-14 20:19  navas  阅读(945)  评论(0编辑  收藏  举报