可以使用string.h头文件中的strcat函数 char a="123";char b = "abc";strcat(a,b)即可,更多的字符串操作可以看一下string.h头文件中 有好多封好的,如果不想用的话就可以自己写一个函数 函数内容:1.获取两个字符串的总长度,如total_len=len1+len2然后申请一个动态的数组大小为total_len ...
c语言使用指针实现模拟java/c# string.concat字符串串联方法,#include<stdio.h>void_strcat(char*,constchar*);intmain(void){charsource[]="View";chardest[]="GoldenGolbal";_strcat(dest,source);printf("%s\n",dest);}//appendstringfr
#include <stdio.h>void_strcat(char*,constchar*);intmain(void) {charsource[] ="View";chardest[] ="GoldenGolbal"; _strcat(dest,source); printf("%s\n",dest); }//append string from source to destvoid_strcat(char* dest,constchar*source) {intj,i=0;while(dest[i] !='\0') { i++...
如果你必须使用一个宏来完成这个任务,那么你似乎需要引入一些间接的方法来完成token的连接。下面是三个宏...