吴裕雄--天生自然C语言开发:字符串
2024-09-07 06:12:04
char greeting[] = {'H', 'e', 'l', 'l', 'o', '\0'};
char greeting[] = "Hello";
#include <stdio.h> int main ()
{
char greeting[] = {'H', 'e', 'l', 'l', 'o', '\0'}; printf("Greeting message: %s\n", greeting ); return ;
}
#include <stdio.h>
#include <string.h> int main ()
{
char str1[] = "Hello";
char str2[] = "World";
char str3[];
int len ; /* 复制 str1 到 str3 */
strcpy(str3, str1);
printf("strcpy( str3, str1) : %s\n", str3 ); /* 连接 str1 和 str2 */
strcat( str1, str2);
printf("strcat( str1, str2): %s\n", str1 ); /* 连接后,str1 的总长度 */
len = strlen(str1);
printf("strlen(str1) : %d\n", len ); return ;
}
最新文章
- cf723c Polycarp at the Radio
- HTML图像映射
- CI分页,搜索之后翻页不能用问题
- Redis学习记录之————微博项目
- 2016 - 1- 22 NSURLConnetction --- GET请求
- 分享一些前端chm文档
- JavaScript高级---组合模式设计
- Android史上功能最全的日历控件
- [Neural Networks] (Convolutional Neural Networks)CNN-卷积神经网络学习
- jquery 自动触发事件 trigger
- hello Kotlin!
- 测试left join和where的优先级
- 2018-4-25 html基础知识
- 记一次idea启动tomcat后控制台乱码的坑
- JavaScript 字典
- Python shelve 模块
- Android Studio 加载网络图片
- Linux服务器tomcat启动maven项目
- Why-are-GPUs-well-suited-to-deep-learning
- tensorflow和python操作中的笔记