學習C的第十天

2021-07-25 15:32:55 字數 836 閱讀 9708

/*

指標的基本表示。

*/#include

int main(void)

/*輸出結果:

5press any key to continue

*/

/*

指標的常見錯誤。

*/#include

int main(void)

/*

用函式交換兩個數的值

*/#include

void huhuan_1(int , int)

int main(void)

/*5 3

press any key to continue

*/

/*

用函式交換兩個數的值

*/#include

void huhuan_2(int * i, int * j)

int main(void)

/*5 3

press any key to continue

*/

/*

用函式交換兩個數的值

*/#include

void huhuan_3(int * i, int * j)

int main(void)/*3

5press any key to continue

*/

初看指標總結:指標相當於郵箱編號,而郵箱內部就是特定的信封(變數),我們可以通過指標找到我們想要的變數。可以在函式中改變主函式中的實參。

學習第十天

一 介面 jdk1.8及之後新增了2中可以定義存在方法體的方法 預設方法 default關鍵字修飾的方法 使用 通過實現類物件使用 靜態方法 使用 通過介面名去呼叫 二 單例模式 保證類只能存在乙個例項 餓漢式 先建立物件,然後需要的人要這個物件,保證永遠使用的都是這個建立好的物件 執行緒安全的,效...

python學習第十天

class student count 0 def init self,name,age,address self.name name self.age age self.address address student.count 1 k print k w open a.txt w encodin...

菜鳥學習第十天

1.字串最大的特點 一旦初始化就不可以改變。不可改變的字串內容而不是指向字串的引用 2.string s abc 其中s是乙個類型別變數,abc 是乙個物件。3.string s1 abc 和string s2 new string abc s1 s2 和s1.equals s2 比較的是他們在記憶...