- 博客(12)
- 资源 (3)
- 问答 (2)
- 收藏
- 关注
原创 串口通信
#include<reg52.h>unsigned char flag,num;void main() { TMOD=0x20;//定时器1工作方式2 TH1=0xfd; TL1=0xfd;//初值设定 SM0=0; SM1=1;//串口工作方式设置,即SCON=0X50; 选择工作模式1使能接收,允许发送,允许接收 PCON = 0x80;//1000
2016-08-03 22:10:22
479
原创 欢迎使用CSDN-markdown编辑器
第一个简单的LED灯闪烁程序#include<reg52.h> #include"Delay.h" sbit LED=P0^0;//第一个LED灯//在主函数之前会有清内存的操作H绻挥衱hile循环,LED灯也会闪烁,因为main()和前面的清内存操作会组合起来形成 //一个循环,所以添加while循环,但是此时LED灯灭的时间比亮的时间要长一点,因为while本身也会被编译成汇编语句 //这是添
2016-07-03 22:46:49
248
转载 窗口句柄HWND和实例句柄HINSTANCE
一个程序可以有多个实例,比如你电脑上可以运行多个QQ程序一样,程序是静态的文件,实例是运行起来的进程;而一个实例可以有多个窗口,程序本身跟窗口没有什么关系,当然你可以认为你的程序里面创建了多个窗口对象。 HWND表示的是窗口的句柄,而HINSTANCE表示的是程序的当前实例的句柄
2016-04-10 12:53:30
1996
原创 MFC基础:Windows内部程序运行原理
#include <windows.h> #include <stdio.h> LRESULT CALLBACK WinSunProc( HWND hwnd, // handle to window UINT uMsg, // message identifier WPARAM wParam, // first message parameter LPARAM
2016-04-10 11:05:00
400
原创 创建窗口时,名字的区别
一共有三个名字 1.WNDCLASS name1;(貌似一般都用wndclass) 2.name1.lpszClassName=”name2” 3.RegisterClass(&name1) 4.HWND hwnd=CreateWindow(“name2”,”name3”,……) 那么什么时候用什么呢? name1:窗口类的名字,用于区分创建的不同的窗口种类 name2:是在窗口na
2016-04-09 21:02:43
483
原创 二叉树的部分操作
以下代码包括二叉树的创建、前中后序遍历(递归)、非递归中序遍历(栈实现)、层序遍历(队列实现)和中序线索化遍历。 main #include<stdio.h> #include<stdlib.h> #include<iostream> #include"Tree.h" #include"Queue.h" #include"Stack.h" #include"Tree.h" #include"Marc
2016-04-07 17:57:09
446
原创 C++类
#include<iostream>using namespace std;//为什么只能是std???//class 声明时,在缺省时,默认为private //struct则为public class Point { public: int x; int y; //构造函数,采用类的名字,唯一,无返回值,创建对象本身 //每个类必须有一个构造函数,没有则不能创建任
2016-04-04 15:55:20
240
原创 引用
!引用和指针变量的内存模型 引用不需要占用额外的内存地址,而指针变量则需要额外分配内存,常用于函数传参。int change(int &a,int &b) {}main() { int a=3,b=4; change(a,b); }
2016-04-04 15:41:05
270
原创 纯虚函数
//含有纯虚函数的类不能实例化对象 //只有当这个函数在子类中实现之后,才能实例化对象 //用处:当某个行为是必须的,但对于不同的对象具体的实现方法不同(如animal中breathe的方式不同) //可在父类中将其设置为纯虚函数 //然后再子类中具体实现 #include<iostream> using namespace std; class animal { public: an
2016-04-04 15:27:10
585
原创 多态性
//继承 #include<iostream> using namespace std; class animal { public: animal(int hight, int weight) { //cout << "animal construct" << endl; } ~animal() { //cout << "an
2016-04-04 15:15:18
210
原创 函数覆盖
函数覆盖只能发生在父类和子类之间//继承includeusing namespace std; class animal { public: animal(int hight, int weight) { //cout << “animal construct” << endl; } ~animal() {
2016-04-04 14:40:53
453
原创 继承
//继承 #include<iostream.h> class animal { public: void eat() { cout << "animal eat" <<endl; } protected: void sleep() { cout <<"animal sleep"<<endl; } private:
2016-04-04 14:29:12
219
opencv_python-3.4.2.17-cp27-cp27m-win32
2018-08-23
交换机下接无线路由器 怎么设置上网方式 WAN LAN
2016-04-27
TA创建的收藏夹 TA关注的收藏夹
TA关注的人