C/C++
Pompey_Wang
这个作者很懒,什么都没留下…
展开
-
C++ 类public、pravite、protected
1、类成员public、pravite、protected属性的介绍public:对内\外均可见private:对外不可见,对内可见protected:对外不可见,对内可见,对派生类可见 #include <iostream>using namespace std;class number //声明一个number的类 { int a; p...原创 2018-07-21 15:20:52 · 3280 阅读 · 0 评论 -
qt服务器搭建
第一步:前奏工作 1、 pro文件添加类库 network,Qt += core gui network 。 2、dialog.h 或者其他中 添加头文件: #include <QTcpServer> 和 #include <QTcpSocket>。 3、定义服务器和客户端对象:QTcpServer ser; //服务器对象...原创 2018-08-02 16:16:34 · 534 阅读 · 0 评论 -
qt 客户端的实现
1、 .h文件#ifndef CLIENT_H#define CLIENT_H#include <QWidget>#include <QTcpSocket>namespace Ui {class client;}class client : public QWidget{ Q_OBJECTpublic: explicit c...原创 2018-08-02 16:55:11 · 2222 阅读 · 1 评论 -
Qt信号之自定义信号槽
1、新建一个后台控制qt项目;添加两个类:newspaper 和 paper2、程序功能实现:通过调用name_to_reader()函数,将信号从一个类,传到另一个类里。 类与类之间是不能直接通信的,通过这个程序,展示了类间的通信,信号之间的传参。3、程序:newspaper.h#ifndef NEWSPAPER_H#define NEWSPAPER_H#i...原创 2018-08-13 18:54:30 · 1280 阅读 · 0 评论 -
驱动之初始化硬件
#include <linux/init.h>#include <linux/module.h>#include <linux/fs.h>#define LED_MA 500#define LED_MI 0#define LED_NUM 1int led_init(void){ int ret; //创建设备...原创 2018-08-23 14:28:56 · 597 阅读 · 0 评论 -
驱动模块及makefile
驱动模块:/************************************************************************* > File Name: driver_moudle.c > Author: Pompey Wong > FUNCTION: > Created Time: Mon 29 Oct 2018 10:2...原创 2019-02-23 00:06:20 · 171 阅读 · 0 评论 -
驱动模块_2
/************************************************************************* > File Name: driver_moudle.c > Author: Pompey Wong > FUNCTION: > Created Time: Mon 29 Oct 2018 10:27:56 PM ...原创 2019-02-23 00:09:50 · 156 阅读 · 0 评论 -
C++ 存储类型之regitster、static、extern
1、register:将变存储于寄存器中{ register int i;}2、static:变量的生命周期是整个程序周期,修饰全局变量时,不允许外部文件对该变量进行访问。#include <iostream>using namespace std; int test(){ static int i = 0; return (++i);}...原创 2019-03-18 17:22:42 · 217 阅读 · 0 评论 -
C++ 构造函数与析构函数
1、什么是构造函数/析构函数: 首先,他们都是类的成员函数,名字和类名相同(析构在类名前加‘~’),没有返回值,没有void且可被重载。若用户未自定义,则编译器自动生成,其最大的特点就是类定义对象(或对象消亡)时自动运行的一个函数。2、实例分析#include <iostream>using namespace std;class A{ public: ...原创 2019-03-26 15:20:15 · 176 阅读 · 0 评论