C 實用程式設計小技巧(不定時更新)

2021-08-15 21:11:15 字數 676 閱讀 9197

//棧的定義及入棧出棧操作

#include

//定義

stack

stk;

//入棧

stk.push();

//列印並出棧

while(!stk.empty())

{ cout

<字串→int

//引入標頭檔案

#include

string s = to_string(int n)

int→字串

//利用標準庫中的atoi函式(可以過濾掉字首0)

string s = 12345;

int m = atoi(s.c_str())

//利用algorithm中的reverse函式

#includereverse(s.begin(),s.end());

//引入標頭檔案

#include

cout

<2)《這裡setprecision(2)表示保留小數點後2位,如果不加fixed那麼只會輸出有效數字。

n = 0.5000000;

cout

<2)<2)《第一次結果是0.5,第二次結果是0.50

Extjs 實用 不定時更新

用ext做專案,總結的一些屬性針對不同控制項 1.grid 中,編輯 內容時的點選變輸入框 plugins cellediting 點選變輸入框 columns 2.輸入框內容驗證 msgtarget side 錯誤顯示嘆號 validator function value 3.只可操作當前視窗 在...

Ajax的小知識(不定時更新)

1 get請求會向資料庫發索取資料的請求,從而來獲取資訊,該請求就像資料庫的select操作一樣,只是用來查詢一下資料,不會修改 增加資料,不會影響資源的內容,即該請求不會產生 無論進行多少次操作,結果都是一樣的。2 與get不同的是,put請求是向伺服器端傳送資料的,從而改變資訊,該請求就像資料庫...

C 實用小技巧

系統自帶全球唯一標示id system.guid.newguid tostring 字元竄或者變數前加乙個 標示為路徑 muban.doc 複製檔案 system.io.file.copy 檔案路徑,檔案路徑 刪除檔案 system.io.file.delete 檔案路徑 結束程序 foreach ...