- https://replit.com/@tony1966/c-test#ch11-struct/Example01.c
- https://replit.com/@tony1966/c-test#ch11-struct/Example02.c
- https://replit.com/@tony1966/c-test#ch11-struct/Example03.c
- https://replit.com/@tony1966/c-test#ch11-struct/Example04.c
- https://replit.com/@tony1966/c-test#ch11-struct/test01.c
- https://replit.com/@tony1966/c-test#ch11-struct/test02.c
- https://replit.com/@tony1966/c-test#ch11-struct/test03.c
- https://replit.com/@tony1966/c-test#ch11-struct/test04.c
- https://replit.com/@tony1966/c-test#ch11-struct/test05.c
- https://replit.com/@tony1966/c-test#ch11-struct/test06.c
- https://replit.com/@tony1966/c-test#ch11-struct/test07.c
- https://replit.com/@tony1966/c-test#ch11-struct/test08.c
- https://replit.com/@tony1966/c-test#ch11-struct/test09.c
- https://replit.com/@tony1966/c-test#ch11-struct/test10.c
- https://replit.com/@tony1966/c-test#ch11-struct/test11.c
- https://replit.com/@tony1966/c-test#ch11-struct/test12.c
- https://replit.com/@tony1966/c-test#ch11-struct/test13.c
練習題 :
- 在C程式宣告名為record的結構,內含2個int型態的成員變數a和b,和1個float型態的成員變數c,然後建立結構變數test,指定float型態的成員值為123.6,和2個int型態的成員值都為150,最後計算和顯示成員變數的總和。
https://replit.com/@tony1966/c-test#ch11-struct/practice01.c - 請繼續實作題1,宣告結構指標ptr指向test,然後使用兩種指標方式來分別指定int成員變數值為88和67,和計算和顯示成員變數的平均。
https://replit.com/@tony1966/c-test#ch11-struct/practice02.c - 請建立C程式宣告employee結構來儲存員工資料,包含姓名、年齡和薪水,然後建立結構陣列儲存5位員工的基本資料。
https://replit.com/@tony1966/c-test#ch11-struct/practice03.c - 請建立C程式宣告item結構,擁有成員變數name字串(大小為20), 2個整數變數arms和legs儲存有幾隻手和腳,然後使用結構陣列儲存下表的項目,最後一一顯示項目的成員變數值,如下所示:(Human、 2、 2)、 (Cat,0,4)、 (Dog,0,4)、 (Table,0,4)
https://replit.com/@tony1966/c-test#ch11-struct/practice04.c
作業 :
- 下列程式碼會在哪一行出現編譯錯誤?
struct user {
char *name;
};
struct user users[5];
users.name[0]="Tony"; - 下列的結構宣告哪裡有錯?
struct member {
char name[30];
struct member no;
}
沒有留言:
張貼留言