C语言教程
C语言控制语句
C语言函数
C语言数组
C语言指针
C语言字符串
C语言数学函数
C语言结构
C语言文件处理
C预处理器

C语言strcpy()函数

strcpy(destination,source)函数将源字符串复制到目标位置。
#include<stdio.h>
#include <string.h>  
int main(){  
 char ch[20]={'j', 'a', 'v', 'a', 't', 'p', 'o', 'i', 'n', 't', '\0'};  
   char ch2[20];  
   strcpy(ch2,ch);  
   printf("Value of second string is: %s",ch2);  
 return 0;  
}  
输出:
Value of second string is: lidihuo
昵称: 邮箱:
Copyright © 2022 立地货 All Rights Reserved.
备案号:京ICP备14037608号-4