stringcat再会
#include <iostream>using namespace std;void stringcat(char *source,const char *dest);int main(){char s1[30]="I LOVE ";char *s2="C++";stringcat(s1,s2);cout<<s1<<endl;return 0;}void stringcat(char *source,const char *dest){int i;char *p;for(p=source;*p!='\0';p++);for(i=0;dest[i]!=0;i++,p++){*p=dest[i];}*p='\0';return;}
心得体会:从这篇博文开始。新的一轮学习浪潮掀起!字符串的连接,主要是指针的运用,加不加“*”的区别,现在仍然模糊,看书找找答案吧今夜。