#include<stdio.h> #include<string.h> int main(){ char name[]={"Chinanet"},destin[20]={}; strncpy(destin,name,3); printf("%s\n",destin); }
Chi
#include<stdio.h> #include<string.h> int main(){ char name[]={"Chinanet"},destin[20]={}; strncpy(destin,name,3); printf("%s\n",destin); }
Chi
上一篇:strncat
下一篇:typedef 基本类型
标准的库函数strncpy这个函数,作用是字符串实现赋值,这个三个参数,第一个参数就是
strncpy 是 C语言的库函数之一,来自 C语言标准库,定义于 string.h,char *st
strncpy strncat strncmp函数的基本用法
,但执行时因系统不同会出现不同的结果:Mac系统提示“Ab...
<!doctype html> <html> <head> <meta charset="utf-8"> <script type="text/javascript" src="js/jquery1.7.2.min.js"></script> <title>查看更多---收起:
举报文章
请选择举报类型
补充说明
0/200
上传截图
格式支持JPEG/PNG/JPG,图片不超过1.9M