原创 類構造,析構,賦值,拷貝

類的普通構造函數: 函數名與類名一樣的函數; 拷貝構造函數:函數名與類名一樣 參數也是類的類型; 析構函數:~String(void) delete 刪除構造函數; 賦值構造函數:重載運算符= 關鍵字(opera

原创 解析字符串substr

#include <iostream> #include <string> int main() { /*Myvector<double> vec; vec.push(1.1f); system("paus

原创 文件讀取(讀取圖片)

bool hexFile(const char* DestFile, const char* SrcFile) { FILE* fpRead = fopen(SrcFile, "r+b");//定義句柄 FI

原创 橡皮怪Dici,over,welcome,player

Dici cc.Class({ extends: cc.Component, properties: { //主角遇刺音效 dieAudio: {

原创 !非

void main() { int a = 0; int b = 0; for (; b<10;b++) { a==0 ? std::cout << "wo" : std::cout

原创

訪問私有成員 #include <iostream> using namespace std; class Box { public: double length; void setWidth(

原创 文件讀取

sprintf() strcpy(buf, “”); char buf1[]=”I”; char buf2[]=”you!”; sprintf(buf, “%s love %s”, buf1, buf2);

原创 運算符和輸出函數

一.邏輯運算符; 1代表’真’ 0代表’假’ && 與 兩個條件都需要滿足 1&&1 1; 1 && 0 0; &(地址符) 讀 and

原创 數組,楊輝,矩陣翻轉

void main() { int i = 1; char arr[21] = {}; char* p = NULL; p = arr; for (int i = 0; i < 20; i+

原创 c++學習

#include <iostream> #include <cmath> void evaluation() { int i=0, j, sum=0, max=0, min=0; std::cout <<

原创 語句

程序語句的三種結構 順序 選擇 循環 表達式語句: 算術表達式:a+b;a*b;a++; 關係表達式:a>b;a==b; 邏輯表達式:!0; !真; C語言控制語句①條件語句:if—else語句

原创 容器

#include <iostream> #include <string> #include <vector> #include <list> #include <map> #include <set> #include <deq

原创 bmp文件

F12 CTRK d 搜索 #include <Windows.h> #include <stdio.h> #include <stdlib.h> #include <string.h> void _fread(const

原创 vector的應用

2.定義vector,放入數字1-52,分別代表各花色的撲克牌.從小到大爲黑紅梅方,1-K. 隨機給四個玩家發3張牌,並打印牌面 #include <iostream> #include <string> #include <v

原创 重載運算

加號重載 class Clock { private: int Time; int Minute; int Seecond; public: Clock(); Clock(int time