![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
c++
萌萌松
渣渣
展开
-
c++ vs 2015 新建一个项目出现的问题
刚用vs2015,新建了一个项目,然而并没有出现下图。一定在这找视图》解决方案资源管理器就会出来原创 2019-04-07 20:53:20 · 485 阅读 · 0 评论 -
c++核心篇11(继承与派生)
1.以公有方式继承#include <iostream> using namespace std;class CEmployee //定义员工类{public: int m_ID; //定义员工ID char m...原创 2019-05-04 17:46:13 · 469 阅读 · 0 评论 -
c++核心技术10(类和对象)
1.使用构造函数进行初始化操作#include <iostream>using namespace std;class CPerson{public: CPerson(); CPerson(int ilndex, short m_shAge, double m_dSalary); int m_ilndex; short m_shAge; double m_dSala...原创 2019-04-28 11:45:11 · 310 阅读 · 0 评论 -
c++基础篇5(循环语句)
1.实现1到10的求和(while)#include <iostream>//using namespace std;void main(){ int i = 1,sum=0; while (i <= 10) { sum = sum + i; i = i + 1; } printf("sum=%d\n",sum); system("pause");}...原创 2019-04-18 14:15:22 · 872 阅读 · 0 评论 -
c++基础篇8(构造数据类型)
1.为结构体成员赋值#include <iostream>using namespace std;void main(){ struct Personlnfo { int index; char name[30]; short age; }plnfo; plnfo.index = 0; plnfo.age = 20; cout << pln...原创 2019-04-25 21:39:18 · 577 阅读 · 0 评论 -
c++基础篇7(数组、指针、引用)
1.单一数组元素赋值#include <iostream>using namespace std;void main(){ char a[3]; a[0] = 'j'; a[2] = 'k'; cout << a[0] << endl; system("pause");}结果:2.一维数组赋值#include <iost...原创 2019-04-21 21:06:13 · 147 阅读 · 0 评论 -
c++ 基础篇3(表达式与语句)
1求逻辑表达式的值#include<iostream>void main(){ int i = 5, j = 8, k = 12, l = 4, x1, x2; x1 = i > j&&k > l; x2 = !(i > j) && k > l; printf("%d,%d\n", x1, x2); system(...原创 2019-04-09 22:45:34 · 173 阅读 · 0 评论 -
c++基础篇4(条件判断语句)
1.判断输入数是否为奇数#include<iostream>using namespace std;void main(){ int input; cout << "请输入整数" << endl; cin >> input; if (input % 2 != 0) { cout << "输入为奇数" <<...原创 2019-04-12 14:55:13 · 15143 阅读 · 0 评论 -
c++基础篇2(数据类型)
1.字符型数据进行运算#include <iostream>//using namespace std;void main(){ char ch1, ch2; ch1 = 'a'; ch2 = 'A'; printf("ch1=%d\n",ch1); printf("ch2=%d\n",ch2); printf("ch1=%c,ch2=%c\n", ch1 - 32...原创 2019-04-09 10:02:13 · 132 阅读 · 0 评论 -
c++运行报错
一严重性 代码 说明 项目 文件 行 禁止显示状态错误 LNK1168 无法打开 D:\Documents\Visual Studio 2015\Projects\Project3-2.2\Debug\Project3-2.2.exe 进行写入 Project3-2.2 D:\Documents\Visual Studio 2015\Projects\Project3-2.2\Project3...原创 2019-04-09 09:12:35 · 854 阅读 · 0 评论 -
c++字符型数据与整数型数据间运算
#include <iostream>using namespace std;void main(){ char a1, a2; a1 = 'a'; a2 = 'b'; printf("%c%d\n%c%d\n", a1, a1, a2, a2); printf("%c,%d\n%c,%d\n", a1, a1, a2, a2); system("pause");}...翻译 2019-04-08 22:45:22 · 981 阅读 · 0 评论 -
c++ 输出字符常量
#include <iostream>void main(){ std::cout << "A" << std::endl; std::cout << "\101" << std::endl; std::cout << "\x41" << std::endl; std::cout << "\...翻译 2019-04-08 22:32:02 · 1616 阅读 · 0 评论 -
c++ 输出常量
#include <iostream>using namespace std;void main(){ cout << 2017 << endl; cout << 2.17 << endl; cout << 'a' << endl; cout << "jk"<< endl; ...翻译 2019-04-08 21:51:19 · 1200 阅读 · 0 评论 -
c++ 注释例子
/*zhushi.cpp*/ #include <iostream> //头文件引用using namespace std; //命名空间void main() //主函数{ cout << "helloworld\n"; //执行输出...翻译 2019-04-07 21:30:49 · 796 阅读 · 0 评论 -
c++ 实现helloworld例子(vs2015)
#include <iostream>using namespace std; //cout需要用void main(){ cout << "helloworld\n"; system("pause"); //显示控制台窗口}原创 2019-04-07 20:56:14 · 1314 阅读 · 0 评论 -
c++基础篇6(函数)
1.声明、定义和使用函数#include <iostream>using namespace std;void show(); //函数声明语句void main(){ show(); //函数调用 system("pause");}void show() //函数定义{ cout << "爱你,胖胖" <<...原创 2019-04-19 21:20:33 · 1904 阅读 · 0 评论