上一页 1 ··· 111 112 113 114 115 116 117 118 119 ··· 164 下一页
摘要: 什么时函数重载: 函数重载是指在同一作用域内,可以有一组具有相同函数名,不同参数列表的函数,这组函数被称为重载函数。重载函数通常用来命名一组功能相似的函数,这样做减少了函数名的数量,避免了名字空间的污染 这些同名函数的形参列表(参数“个数” 或 “类型” 或 “顺序”)必须不同,常用来处理实现功能类 阅读全文
posted @ 2020-08-04 10:39 天子骄龙 阅读(213) 评论(0) 推荐(0)
摘要: && 等价 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 天子骄龙 阅读(215) 评论(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 天子骄龙 阅读(1304) 评论(0) 推荐(0)
摘要: 定义: namespace 名字空间名{ 名字空间成员1; 名字空间成员2; ......} 注:名字空间成员可以是全局变量、全局函数、类型、名字空间 名字空间成员的使用: :: 作用域限定操作符名字空间名::要访问的成员 #include <iostream> namespace nm1{ //定 阅读全文
posted @ 2020-07-30 08:57 天子骄龙 阅读(192) 评论(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 天子骄龙 阅读(321) 评论(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 天子骄龙 阅读(153) 评论(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 天子骄龙 阅读(811) 评论(0) 推荐(0)
上一页 1 ··· 111 112 113 114 115 116 117 118 119 ··· 164 下一页