摘要:
#include <iostream> #include <chrono> #include <thread> void printNumbers1() { for (int i = 1; i <= 10000; i++) { std::cout << "Thread 1: " << i << st
閱讀全文
摘要:
auto 是 C++11 中新增的一種類型推導(dǎo)關(guān)鍵字,可以根據(jù)變量的初始化表達式,自動推導(dǎo)出相應(yīng)的類型。使用 auto 可以簡化代碼,減少類型錯誤的發(fā)生,提高代碼的可讀性和可維護性。 下面是 auto 的使用示例,假設(shè)我們有一個整數(shù)變量 x,可以這樣使用 auto 進行類型推導(dǎo): auto x =
閱讀全文
摘要:
#include <iostream> #include <vector> int main() { std::vector<std::string> con; con.push_back("9999"); std::cout<<con[0]; return 0; } vector搞了一個多態(tài),你可
閱讀全文
摘要:
這個也是和Java不同的地方,作用是為了防止類的名字沖突 #include <iostream> namespace myspace{ class A{ public: std::string head; private: std::string body; }; } namespace myspa
閱讀全文
摘要:
這個是用來include的防止多次重復(fù)include #ifndef A_H #define A_H int test(){ } #endif
閱讀全文
摘要:
#include <iostream> class A{ public: std::string head; private: std::string body; }; int main() { A a; a.head="888"; a.body="999"; return 0; } 報錯結(jié)果 ma
閱讀全文
摘要:
#include <iostream> class A{ public: std::string head; void hello(std::string str){ std::cout<<str<<head<<std::endl; } }; int main() { A a; std::strin
閱讀全文
摘要:
環(huán)境需求: You will need Android NDK r15 or higher to build Ceres solver. eigen3我當(dāng)時編譯的時候自己先交叉編譯了eigen3,這個東西好像只有頭文件,好像不存在移植,都是通用的 編譯 cmake \ -DCMAKE_TOOLCHA
閱讀全文
摘要:
需要的工具:U盤 1. 打開ubuntu啟動盤制作工具,下載ubuntu鏡像,制作啟動器 2.u盤啟動,進入try ubuntu 3.終端打開gparted 分割出一塊合適大小的nfts區(qū)域用來裝windows,如果直接用ubuntu的話由于本身的磁盤就在使用所以不能操作,只能在類似pe的系統(tǒng)里面操
閱讀全文
摘要:
打開wireshark發(fā)現(xiàn)很多MDNS,數(shù)據(jù)內(nèi)容是xxx的手機,比如雞兒的手機 答案: MDNS是指多播域名解析協(xié)議(Multicast Domain Name System),也稱為零配置網(wǎng)絡(luò)。它是一種用于在局域網(wǎng)上自動發(fā)現(xiàn)網(wǎng)絡(luò)設(shè)備和服務(wù)的協(xié)議,使得設(shè)備可以在不需要中央服務(wù)器注冊的情況下,通過其名
閱讀全文