会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
喵小喵~
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
26
27
28
29
30
31
32
33
34
···
68
下一页
2018年3月16日
79.QT解决迷宫问题(面向过程与面向对象)
摘要: 面向过程: 创建一个类继承dialog,mydialog,添加两个变量 main.cpp中初始化 dialog.cpp中实现按钮的操作 面向对象: mg.h 1 #ifndef MG_H 2 #define MG_H 3 #include "mydialog.h" 4 5 class mg 6 {
阅读全文
posted @ 2018-03-16 14:27 喵小喵~
阅读(472)
评论(0)
推荐(0)
2018年3月15日
78.委托构造
摘要: 1 #include 2 using namespace std; 3 4 class man 5 { 6 private: 7 int id; 8 char ch; 9 10 public: 11 //0个参数委托一个参数的构造函数,一个参数的委托两个参数的构造函数构造 12 man():man(1) 13 { 14 15 ...
阅读全文
posted @ 2018-03-15 22:43 喵小喵~
阅读(114)
评论(0)
推荐(0)
3.索引与string进行映射实现高效查找
摘要: 1 #include 2 #include //类型索引 3 #include //红黑树 4 #include 5 using namespace std; 6 7 class myclass 8 { 9 10 }; 11 12 void main() 13 { 14 //索引与string进行映射 15 unordered_map mytype;/...
阅读全文
posted @ 2018-03-15 22:31 喵小喵~
阅读(188)
评论(0)
推荐(0)
77.初始化数据,如果类中有其他类,需要重写构造函数
摘要: 1 #include 2 #include 3 #include 4 using namespace std; 5 6 //初始化数据的时候,如果类中引用其他类,需要重写构造函数,int也是类 7 class myclass 8 { 9 public: 10 int x; 11 int y; 12 13 public: 14 myclass(i...
阅读全文
posted @ 2018-03-15 22:25 喵小喵~
阅读(201)
评论(0)
推荐(0)
76.QT槽的机制
摘要: 按钮点击获取文本框输入 1 void Dialog::on_pushButton_clicked() 2 { 3 //获取文本输入 4 QString vstr = ui->lineEdit->text(); 5 6 //判断是否转换成功 7 bool isok; 8 //转换 9 int valu
阅读全文
posted @ 2018-03-15 22:13 喵小喵~
阅读(220)
评论(0)
推荐(0)
75.数组封装用{}初始化,以及{}嵌套初始化
摘要: 一维数组封装 myArray.h myArray.cpp 1 #include "myArray.h" 2 3 myArray::myArray(initializer_list<int> list) 4 { 5 this->n = list.size();//开辟内存 6 this->p = ne
阅读全文
posted @ 2018-03-15 21:33 喵小喵~
阅读(410)
评论(0)
推荐(0)
74.QT窗口实现类的封装
摘要: 1 #include "mainwindow.h" 2 #include 3 #include 4 5 //定义一个窗口类 6 class Window 7 { 8 public: 9 MainWindow *p; 10 int x;//大小 11 int y; 12 int cx;//位置 13 int cy; 14 15 pu...
阅读全文
posted @ 2018-03-15 20:42 喵小喵~
阅读(414)
评论(0)
推荐(0)
73,QT指针数组实战(指针数组与数组指针)
摘要: 1 //指针数组,每一个指针都是一个MainWindow 2 // MainWindow *w[3][4]; 3 // for(int i=0;imove(i*100,j*100); 9 // w[i][j]->resize(100,100); 10 // w[i][j]->show(); 11 // } 12 //...
阅读全文
posted @ 2018-03-15 19:54 喵小喵~
阅读(3987)
评论(0)
推荐(0)
72.函数模板指针与类函数模板的绑定
摘要: 1 #include 2 #include 3 using namespace std; 4 using namespace std::placeholders; 5 6 template 7 void show(T t) 8 { 9 cout 16 void show(T t) 17 { 18 cout ; 30 p(...
阅读全文
posted @ 2018-03-15 16:41 喵小喵~
阅读(204)
评论(0)
推荐(0)
71.lambda表达式的递归
摘要: 1 #include 2 #include 3 using namespace std; 4 5 void main() 6 { 7 //&调用外部 8 //function fun = [&]()->void {cout fun = [&](int i) 10 { 11 if (i == 0) 12 { 13 ...
阅读全文
posted @ 2018-03-15 16:16 喵小喵~
阅读(170)
评论(0)
推荐(0)
上一页
1
···
26
27
28
29
30
31
32
33
34
···
68
下一页
公告