看板
[ TransCSI ]
討論串[問題] 程式:C++ 台大90 第五、六題
共 5 篇文章
內容預覽:
宣告時,會使用建構函數. 預設建構函數為 Ex::Ex();. 動到private成員的也不是main(),是物件本身,Ex::Ex();設定運算子的原型為. Ex & Ex::operator=(const Ex &);. 所以. test1 = test2;. 會執行成員對成員的複製. test
(還有56個字)
內容預覽:
*s指向字元位址*s跟*st指向同一個記憶體位址*s是指標(取值),取址用s就可以了. 字串(字元陣列):. [t][h][i][s][ ][i][s][ ][a][ ][t][e][s][t][\0]. '\0'是null字元,表示字串結束. 空字元(space)是'\32',ASCII代碼是32
(還有377個字)
內容預覽:
1 #include <iostream>. 2 using namespace std;. 3. 4 class Ex. 5 {. 6 public:. 7 Ex() { p = new int; }. 8 void set(int i) { *p = i; }. 9 int get() { re
(還有662個字)
內容預覽:
我先處理這題我覺得比較簡單 1 #include <iostream>. 2 using namespace std;. 3. 4 int what( const char *s). 5 {. 6 int j;. 7 for(j = 0; *s != '\0'; s++). 8 ++j;. 9 re
(還有608個字)
內容預覽:
台大90年度轉學考計概第六題. 1 #include <iostream>. 2 using namespace std.. 3 class Ex {. 4 public:. 5 Ex(){p = new int;}. 6 void set(int i){*p = i;}. 7 int get(){
(還有917個字)