原创 C++信號量condition_variable

目錄 1、condition_variable 2、函數 3、測試 1、condition_variable 同步線程間的數據流依賴關係。 2、函數 Condition_variable cv; 構造 Cv.~Cond

原创 tuple不定值數組

目錄 1、tuple 2、函數 3、測試 1、tuple tuple擴展了pair將兩個元素看成一個單元的功能,實現了可以將任意數量元素當作一個單元的功能。 2、函數 tuple<T1,T2...Tn> t; 以n

原创 Qt標準輸入框

//inputdlg.h #ifndef INPUTDLG_H #define INPUTDLG_H #include <QDialog> #include <QLabel> #include <QPushButton> #inclu

原创 QtUDP簡單實現

目錄 1、Udp服務器 1.1、頭文件 1.2、定義 2、Udp客戶端 2.1 頭文件 2.2 定義 3、顯示 1、Udp服務器 1.1、頭文件 #ifndef UDPSEVER_H #define UDPSEVER_H #inclu

原创 Qt消息框

//msgDialog.h #ifndef MSGDIALOG_H #define MSGDIALOG_H #include <QDialog> #include <QLabel> #include <QPushButton> #in

原创 Qt獲取字體

//.h #ifndef DIALOG_H #define DIALOG_H #include <QDialog> #include <QPushButton> #include <QLineEdit> #include <QGrid

原创 QT獲取顏色

//.h #ifndef DIALOG_H #define DIALOG_H #include <QDialog> #include <QPushButton> #include <QFrame> #include <QColorDi

原创 C++可變參數列表

#include <iostream> using namespace std; //停止解析參數列表 void function() { } template <typename T, typename... U> void

原创 C++ 實現計時器

目錄 timer.h timer.cpp main.cpp timer.h #pragma once #include <iostream> #include <cstdlib> #include <time.h> class tim

原创 Qt獲取本機地址

//widget.h #ifndef WIDGET_H #define WIDGET_H #include <QWidget> #include <QLabel> #include <QPushButton> #include <QL

原创 Qt工具盒

//drawer.h #ifndef DRAWER_H #define DRAWER_H #include <QToolBox> #include <QToolButton> class Drawer : public QToolBo

原创 QT獲取文件名

//.h #ifndef DIALOG_H #define DIALOG_H #include <QDialog> #include <QPushButton> #include <QLineEdit> #include <QGrid

原创 C++全局數值函數

1、頭文件 <cmath>和<cstdlib>。 2、測試 #include <iostream> #include <iomanip> using namespace std; int main() { int iTemp = 0

原创 隨機數分佈C++11

目錄 1、隨機數 2、引擎 2.1 引擎的種類 2.2 引擎的成員函數 2.3 測試 3、分佈 3.1 分佈的種類 3.2 分佈的成員函數 資料參考《C++標準庫》第二版 1、隨機數 1)引擎:隨機性的源頭,用來產生隨機數; 2)分佈:隨

原创 promise object提供數據

目錄 1、promise 2、成員函數  3、測試 1、promise 給線程傳遞參數和獲取異常。 2、成員函數  1)創建 Promise p; default構造函數,建立有個帶有share