上一页 1 2 3 4 5 6 7 8 ··· 10 下一页
摘要: #include<stdio.h> #include<semaphore.h> #include<fcntl.h> #include<stdlib.h> #include<unistd.h> #include<errno.h> void p_error(const char* str) { perr 阅读全文
posted @ 2020-10-17 20:01 sunshine_gzw 阅读(111) 评论(0) 推荐(0) 编辑
摘要: 假设lua中: name="gzw" id=17010805 sex=man tab={ num=100, str="hello" } foo_one=function() print("不带参数的foo()被调用了") end foo_two=function(num) print("num=", 阅读全文
posted @ 2020-10-12 23:44 sunshine_gzw 阅读(189) 评论(0) 推荐(0) 编辑
摘要: Father={ a=100, b=200 } function Father:dis() print(self.a,self.b) end Father.__index=Father Son= { x1=300, x2=400 } function Son:myprint() print(self 阅读全文
posted @ 2020-10-08 20:08 sunshine_gzw 阅读(225) 评论(0) 推荐(0) 编辑
摘要: arr={} mt={} --设置arr的元表为mt setmetatable(arr,mt) print(arr) print(mt) print(getmetatable(arr)) 有了元表,接下来看操作: 如果想要通过索引查找arr里面的值,但是arr里面没有对应的索引,比如: arr={} 阅读全文
posted @ 2020-10-07 21:02 sunshine_gzw 阅读(143) 评论(0) 推荐(0) 编辑
摘要: 先看两个例子,比较不同: 例一(有回调函数) #include <iostream> using namespace std; void foo_one() { cout<<"foo_one"<<endl; } void foo_two() { cout<<"foo_two"<<endl; } ty 阅读全文
posted @ 2020-10-04 12:28 sunshine_gzw 阅读(131) 评论(0) 推荐(0) 编辑
摘要: 以下是main函数最开始的两段,也是cocos2d一开始执行的地方: AppDelegate app; return Application::getInstance()->run(); 接下来用代码对以上函数进行简单复原: #include<iostream> #include<assert.h> 阅读全文
posted @ 2020-10-03 19:27 sunshine_gzw 阅读(262) 评论(0) 推荐(0) 编辑
摘要: namespace myspace6 { template<typename T1> class TC { public: template<typename T2> TC(T2 v1, T2 v2) { cout << "TC(T2 v1,T2 V2)被执行了" << endl; } TC(T1 阅读全文
posted @ 2020-09-18 15:20 sunshine_gzw 阅读(3784) 评论(0) 推荐(0) 编辑
摘要: https://blog.csdn.net/Makenzie/article/details/68486412?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-1.channel_par 阅读全文
posted @ 2020-09-17 20:51 sunshine_gzw 阅读(181) 评论(0) 推荐(0) 编辑
摘要: namespace _myspace{ template<typename T, typename U> class TC { public: TC() { cout << "TC()的泛化版本" << endl; } void testone() { cout << "泛化版本函数:void te 阅读全文
posted @ 2020-09-17 10:34 sunshine_gzw 阅读(203) 评论(0) 推荐(0) 编辑
摘要: 效果图: 可以实现打开图片,在打开的图片上画图,可以保存图片,以及橡皮擦,画笔调大调粗换色功能。 代码: XImage.h: #ifndef __XIMAGE__H__ #define __XIMAGE__H__ #include "qwidget.h" #include<QPaintEvent> 阅读全文
posted @ 2020-09-08 11:31 sunshine_gzw 阅读(1928) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 10 下一页