16. auto double int struct
break else long switch
case enum register typedef
char extern return union
คําสงวน Reserve word ของภาษา C
const float short unsigned
continue for signed void
default goto sizeof volatile
do if static While
asm _cs _ds _es
_ss cdecl far huge
interrupt near pascal _export
19. • ในภาษา C ประโยค (statement) ของการประกาศตัวแปร สามารถ
กําหนดค่าเริมต้นให้กับตัวแปรได้ทันที
โดยใช้รูปแบบ ชนิดตัวแปร ชือตัวแปร = ค่าเริมต้น;
การประกาศตัวแปรพร้อมให้ค่าเริมต้น
เช่น int i = 5;
นอกจากนียังสามารถประกาศ หลายๆ ตัวแปรในบรรทัดเดียว
กันได้อีก
เช่น int i = 5, k = 3, y;
20. #include <stdio.h>#include <stdio.h>#include <stdio.h>#include <stdio.h>
voidvoidvoidvoid main ()main ()main ()main ()
{{{{
int age;int age;int age;int age;
char sex;char sex;char sex;char sex;
#include <stdio.h>#include <stdio.h>#include <stdio.h>#include <stdio.h>
voidvoidvoidvoid main ()main ()main ()main ()
{{{{
int age =int age =int age =int age = 20202020;;;;
char sex = ‘ f ’;char sex = ‘ f ’;char sex = ‘ f ’;char sex = ‘ f ’;
วิธีการสร้างตัวแปรและการกําหนดค่า
char sex;char sex;char sex;char sex;
float grade;float grade;float grade;float grade;
age =age =age =age = 20202020;;;;
sex = ‘ f ’;sex = ‘ f ’;sex = ‘ f ’;sex = ‘ f ’;
grade =grade =grade =grade = 3333....14141414;;;;
}}}}
char sex = ‘ f ’;char sex = ‘ f ’;char sex = ‘ f ’;char sex = ‘ f ’;
float grade =float grade =float grade =float grade = 3333....14141414;;;;
char name[char name[char name[char name[10101010] = “malee”] = “malee”] = “malee”] = “malee”
printf(“you are %sprintf(“you are %sprintf(“you are %sprintf(“you are %sn”,name);n”,name);n”,name);n”,name);
............
}}}}