上一页 1 ··· 111 112 113 114 115 116 117 118 119 ··· 164 下一页
摘要: && 等价 and|| 等价 or{ 等价 <%} 等价 %> 阅读全文
posted @ 2020-08-04 07:19 天子骄龙 阅读(165) 评论(0) 推荐(0)
摘要: #include <iostream> #include <string> //导入类,同时必须使用 using namespace std; //这个类是窄字节的 using namespace std; int main () { string str1 = "Hello 李明"; string 阅读全文
posted @ 2020-07-31 20:12 天子骄龙 阅读(213) 评论(0) 推荐(0)
摘要: 安装:https://www.zhihu.com/question/65989308 多行注释:先CTRL+K,然后CTRL+C 取消注释: 先CTRL+K,然后CTRL+U 字体:工具 >选项-->字体和颜色 番茄助手安装:https://www.cnblogs.com/vuciao/p/1060 阅读全文
posted @ 2020-07-31 16:43 天子骄龙 阅读(1301) 评论(0) 推荐(0)
摘要: 定义: namespace 名字空间名{ 名字空间成员1; 名字空间成员2; ......} 注:名字空间成员可以是全局变量、全局函数、类型、名字空间 名字空间成员的使用: :: 作用域限定操作符名字空间名::要访问的成员 #include <iostream> namespace nm1{ //定 阅读全文
posted @ 2020-07-30 08:57 天子骄龙 阅读(191) 评论(0) 推荐(0)
摘要: cout #include <iostream> //标准输入输出流 int main(){ int num=0; std::cout<<"请输入一个值:"; std::cin>>num; //用户输入一个值给变量num //c表示终端,in表示输入,>>输入操作符 std::cout<<num < 阅读全文
posted @ 2020-07-30 06:20 天子骄龙 阅读(320) 评论(0) 推荐(0)
摘要: #include <iostream> struct student { int a; int b; int add(){ //在结构体内封装了函数 return a+b; } }; int main(){ student s={10,20}; //c++时struct 可以省略 int x=s.a 阅读全文
posted @ 2020-07-29 21:12 天子骄龙 阅读(156) 评论(0) 推荐(0)
摘要: C++标准输入、输出 名字空间 结构体 VS2017安装C++ 命名空间 向量vector string类 c++字符串 窄字节宽字节 Cstring Ansi与Unicode 操作符别名 函数的重载 在C++中用C编译函数-extern "C" {} 函数的缺省参数 函数的哑元参数 内联函数 ne 阅读全文
posted @ 2020-07-29 18:34 天子骄龙 阅读(696) 评论(0) 推荐(0)
摘要: 预处理指令: #include <stdio.h> int main() { //条件编译 #if 0 printf("我是中国人\n") ; //不会被编译 #endif #if 1 printf("我喜欢中国\n") ; #endif #if 0 printf("wo\n") ; #elif 1 阅读全文
posted @ 2020-07-29 17:12 天子骄龙 阅读(152) 评论(0) 推荐(0)
摘要: fwrite() 写二进制文件 格式:size_t fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream) #include<stdio.h> int main () { FILE *fp; char str[] = "Thi 阅读全文
posted @ 2020-07-26 15:09 天子骄龙 阅读(806) 评论(0) 推荐(0)
摘要: #include <stdio.h> int main() { FILE *fp=fopen("ss.txt","r"); //打开文件并创建文件指针 //实际上是由系统定义的一个结构,该结构中含有文件名、文件状态和文件当前位置等信息 //在进行读写操作之前要先打开,使用完毕要关闭 //在打开一个文 阅读全文
posted @ 2020-07-26 10:56 天子骄龙 阅读(929) 评论(0) 推荐(0)
上一页 1 ··· 111 112 113 114 115 116 117 118 119 ··· 164 下一页