enum Enum Day Of Weeksun 1 mon tue
- Slides: 35
ตวอยางการกำหนดคา enum Enum Day. Of. Week{sun=, 1 mon, tue , wen, thu, fri, sat ; { คาคอ sun=1, mon=2, tue=3, wen=4, thu=5 , fri=6 , sat = 7
ตวอยางการกำหนดคา enum Day. Of. Week{sun=, 1 mon, tue, wen=50, thu, fri, sat; { คาคอ sun=1, mon=2, tue=3, wen=50, thu=51 , fri=52, sat=53
. 3. 1การใช คำสง struct สรางตวแปรชนด โดยตรง student คอ ประกาศตวแปรไปพรอมกบการสราง struct STD { char code[9]; char name[31]; int midterm; int final; char grade; } student; struct product { int weight; float price; } apple, banana, melon;
3. 2การใช คำสง struct สรางตวแปรชนด student ผานตวแปร STD คอ ประกาศตวแปร หลงจากสราง struct STD แลว structure struct product { char code[9]; { int weight; char name[31]; int midterm; float price; int final; }; char grade; product apple; }; product banana, melon; STD student; // ����� Student ����� STD
3. 3การใช คำสง typedef เพอสรางตวแปรชนด struct student ผานตวแปร typedef struct { char code[9]; char name[31]; int midterm; int final; char grade; } STD; STD student; STD #define MAX_LEN 12 /* Length of name */ typedef struct { char name[MAX_LEN]; int id; float gpa; char major[10]; } product; product stu 1, stu 2, stu 3;
ตวอยางโปรแกรม typedef struct { int month, day, year; } DATE; void main( ) { DATE d 1; d 1. month = 12; d 1. day = 2; d 1. year = 1970; }
การกำหนดคาเรมตนใหกบตวแป ร struct CAR { char color[10] = “Black”; long price = 40000; } mycar; w [C++ Error] ………. cpp(6): E 2233 Cannot initialize a class member here
ตวอยาง : การกำหนดคาเรมตนใหกบตวแป ร struct CAR { char color[10] = “Red”; long price = 30000; } hiscar; w [C++ Error] ………. cpp(6): E 2233 Cannot initialize a class member here
. 5การกำหนดคาคงทใหกบสมาชกของ structure struct STD { char code[9]; char name[31]; int midterm; int final; char grade; }student, stud; ������� STD ������� student , stud �������
5. 1. กำหนดคาคงทใหกบ เขยนไดดงน structure strcpy(student. code, "40214514"); //เนองจากเปน string ตองใช strcpy() strcpy(student. name, "Somsak; (" student. midterm = 45 ; student. final = 30 ; student. grade=75 ;
5. 2. การกาหนดคาของตวแปร ใหกบ structure เขยนไดดงน char co[9]=” 10015210”; strcpy(student. code, co); int x = 25; student. midterm = x;
6. อารเรยของ structure struct STD //สราง structure ชอ } char code[9]; char name[31]; int midterm; int final; char grade; }; STD student[5]; //ประกาศตวแปรชอ student เปนอารเรยรายการ 5 STD
7. โครงสรางแบบซอนใน § โครงสรางอาจมการซอนกนไดเชน struc { date int int }; date; month; year; struc emprec { char name[21]; char address[21]; char town[21]; char postcode[9]; struc date start; } employee;
- Day 1 day 2 day 3 day 4
- Moday tuesday
- Day 1 day 2 day 817
- Sun mon tue
- Mon tue wed thurs fri sat sun
- Mon wed fri
- Sun mon tue wed thu fri
- Sun mon tue wed thu fri sat
- Mon tue thu
- Calendar xx
- Sun mon tue wed thu fri
- Sat sun mon tues wed
- Mon tue wed
- Sun mon tue wed thu fri sat
- Mon & tue
- Mon tues wed
- Mon tue wed thur
- Mon tues wed thurs fri
- Mon tue wed thurs fri sat sun
- Sat sun mon
- Wed thur
- Wed and thur
- Sun mon
- Mon tues wed
- Mon tue wed thu fri sat
- Enum.exe
- Typedef union
- Enum telecom
- Enum vs array
- Partial enum c#
- Enum query ims
- Java enum documentation
- Effective java enum
- Nmap generator
- Internal recon
- Type random things