![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数组
小白一只~
目标是向大佬迈进!争取每天进步一点点!
展开
-
2021-07-01
字符数组和字符串变量string的区别string不是c++语言的基本类型(char,int,float,double等),它是c++标准库中声明的一个字符串类,想要完整使用其功能需要头文件#include< string>(自己去空格)#include<iostream>#include<string.h>#include<string>using namespace std;int main(){ (1)定义 char *c1="I原创 2021-07-01 10:03:27 · 82 阅读 · 0 评论 -
2021-06-27
用指针引用字符串数组及strcat,strcmp,strcpy,strlen的用法#include<iostream>//#include<cstring>#include<string.h>using namespace std;int main(){ //数组名是该数组第一个元素的内存地址 //用引号括起来的字符串也代表该字符串第一个字符的内存地址 char * c="I love C!";//c 是char*类型的指针,指向字符串的第一个原创 2021-06-27 16:19:41 · 121 阅读 · 0 评论