strcat(first_string, second_string)

首页 / C语言入门教程 / strcat(first_string, second_string)

strcat(first_string,second_string)函数连接两个字符串,结果返回给first_string。

#include<stdio.h>
#include<string.h>  
int main(){  
   char ch[10]={'h', 'e', 'l', 'l', 'o', '\0'};  
   char ch2[10]={'c', '\0'};  
   strcat(ch,ch2);  
   printf("Value of first string is: %s",ch);  
   return 0;  
}  

输出:

无涯教程网

链接:https://www.learnfk.comhttps://www.learnfk.com/c-programming/c-strcat.html

来源:LearnFk无涯教程网

Value of first string is: helloc

祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)

技术教程推荐

邱岳的产品实战 -〔邱岳〕

Go语言核心36讲 -〔郝林〕

数据分析实战45讲 -〔陈旸〕

Java并发编程实战 -〔王宝令〕

DDD实战课 -〔欧创新〕

系统性能调优必知必会 -〔陶辉〕

高楼的性能工程实战课 -〔高楼〕

如何成为学习高手 -〔高冷冷〕

LangChain 实战课 -〔黄佳〕

好记忆不如烂笔头。留下您的足迹吧 :)