# 資料結構(20230223) ### 數四甲 S0822014 康維哲 1. 說明Dev-C++的安裝暨使用。 ![](https://i.imgur.com/N7lSjIk.png) 2. 描述C與C++程式基本架構與命名規則的差異。 stdio.h包含了printf, scanf ```c= #include<stdio.h> int main() { int a; a= 5; printf("%d\n", a); return 0; } ``` ```c= #include<iostream> using namespace std; int main(){ int a; a= 5; cout <<a << endl; return 0; } ``` 3. 如何使用Dev-C++的Debug功能。 ![](https://i.imgur.com/b83Kl8j.png) 4. Call by value v.s. Call by address(程式碼上課時公佈)。將程式碼以及Debug的結果截圖。 ```c= #include<stdio.h> void swap1(int, int); void swap2(int *, int *); int main(){ int a= 5, b= 10; printf("a= %d b= %d\n", a, b); swap1(a, b); printf("a= %d b= %d\n", a, b); swap2(&a, &b); printf("a= %d b= %d\n", a, b); return 0; } void swap1( int x, int y){ int temp1= x; x= y; y= temp1; } void swap2( int *m, int *n){ int temp2; temp2= *m; *m= *n; *n= temp2; } ``` ![](https://i.imgur.com/QzKvJaI.png) > 作業繳交方式:寄E-mail > 收件人:lenghs@cc.ncue.edu.tw > 主旨:資料結構(20230223) > 附件:資料結構(20230223) - HackMD.pdf > 內文:本日上課心得(字數不限不得省略)