原创 基類的protected成員可以被派生類成員訪問

class A { protected: //改成private會報錯: "A::numX" (已聲明 所在行數 : 10) 不可訪問 int numX = 100; }; class B: public A { public: v

原创 QByteArray QString string char*相互轉換

char *QByteArray::data()   Returns a pointer to the data stored in the byte array. The pointer can be used to access an

原创 QByteArray與QString

The QByteArray class provides an array of bytes.QByteArray can be used to store both raw bytes (including '\0's) and tr

原创 MDK-ARM v5.23 Add Programming Algorithm

原文地址:http://www.cnblogs.com/huanzxj/p/6346797.html MDK v4 Legacy Support:http://www2.keil.com/mdk5/legacy 問題: JLINK下

原创 虛函數內存分配

C++虛函數內存分配:http://blog.51cto.com/speakingbaicai/1686404  #include <iostream> #include <vector> #include <algorithm> #i

原创 LeetCode89 Gray Code 格雷碼生成

1、十進制序列直接得到格雷碼 參考:https://www.cnblogs.com/logic3/p/5609919.html  binary num             gray code  0=000      000 = 000

原创 Qt5.11.0交叉編譯

操作環境 爲什麼交叉編譯 交叉編譯步驟 1.PC上安裝Debian工具鏈 2.PC上安裝Qt5.11.0 3.下載Qt源文件 3.1解壓 3.2安裝一些必要的庫(如果有就安裝) 3.3配置qmake.conf 3.4新建腳本文件 3.

原创 DS-鏈表實現多項式運算

//每行第一個數表示多項式項數,後面表示係數和指數。data.txt 內容如下: //4 3 4 -5 2 6 1 -2 0 //3 5 20 -7 4 3 1 #include <iostream> #include <fstream

原创 PTA3.3 Tree Traversals Again

An inorder binary tree traversal can be implemented in a non-recursive way with a stack. For example, suppose that when

原创 結構體內存對齊

#include <stdio.h> #include <iostream> typedef struct { char a; //偏移地址0 int b; //偏移地址4 char c[3]; //偏移地址8 doubl

原创 排序

  快速排序quickSort #include <iostream> #include <vector> using namespace std; int findPivot(vector<int> &a, int lo, int

原创 2018網易筆試(未AC)

又到了豐收的季節,恰好小易去牛牛的果園裏遊玩。 牛牛常說他多整個果園的每個地方都瞭如指掌,小易不太相信,所以他想考考牛牛。 在果園裏有N堆蘋果,每堆蘋果的數量爲ai,小易希望知道從左往右數第x個蘋果是屬於哪一堆的。 牛牛覺得問題太簡單了,

原创 C++合法的實型常量

一般形式:12.5 指數形式:E可以大寫或小寫,整數部分和小數部分可以省略其一,但不能都省略。 0.345E+2 == 0.345x10^2 .123e-1     12.e2     1.e-3 都是合法的 E5        12. 

原创 還原二叉樹遍歷序列

已知一顆二叉樹後序序列爲 debfca, 中序序列爲dbeafc, 則先序遍歷爲:abdecf            a        /       \     b           c   /    \       / d     

原创 stringstream用法

#include <iostream> #include <sstream> #include <vector> #include <algorithm> #include <functional> #include <iterator