** çҹ繤Դ繢ͧ¹ͧ 觼ҹ繵ͧ繴令Ѻ
ҡ բʹ ;ͤ ԡ سѧ¹¤Ѻ ӡ䢢
١ͧ Ѻ
Ѻ˹ѡ
 

C ͹ Դŵѡ

㹺͹еͧҡ͹ǤѺ 㹵͹Ƕ֧ԴẺŢѹ 㹵͹ҡѹͧẺѡáѹҧѺ

Դŵѡ
char 繢ŵѡõǢҴ 8 Ե ¨ͧ ö令ӹdz
char a =c;
͡˹ a 繪Դŵѡ(ҹ) ¡˹繵ѡ C
㹡ʴŢŹ鹨еͧ %c 㹡ʴŴ ѧҧ


Ѿѡ C


ҡ¹ѡ¹ѹ char a = 1234; ҷʴҵش


ʴҵش


ҷͧҵѡèԹ 5 ѡ ( пͧ error) ѧ͡˹繪Դ char С˹ѡ§ 1 ѡҹ

ҡҡ˹ʴżԴѾмԴ仴


ŷ ASCII


ѧҧŷ ASCII Ѻ ( ͧ ASCII ¹繺㹵͹令Ѻ)

ԴẺͤ (String type)
Ҩö Դ char ʴẺѡ ٻẺ Array 觢ͤѧǨͧ еͧٻẺ
ʴ %s ·ء
ٻẺ
char ͵ [Ҵ] = ŷͧ ;
char a[20]="www.semi-shop.com";


ٻẺʴ


㹡á˹Ҵù˹ҴԹ͹ ҢҴҢҴáͧ˹
char a[2]="www.semi-shop.com"; // ˹Ҵ
char a[]="www.semi-shop.com"; // ͧ˹Ҵ
ҵͧôҵ˹觢ͧŷ˹ դáö ٻẺʴ %c
char a[10]="0123";
printf("a=%c\n\n",a[3]); // ʴѡ 3


ʴ˹ʴ


ö â char 㹡ҵ˹觢ͧѡ

ҡҹҨ繡¹ C Ẻ鹰ҹ 觶Ҽҹͧ÷¹騹ö¹ҹ 繵ͧդФ㹡觾鹰ҹ͹ Ǩö¹Ẻء觼¹Ƕ֧㹺͹令Ѻ

觾鹰ҹѧաѺ ǴԹ ͹ ǹٻ 觨Ƕ֧令Ѻ


¹ 10 .. 2554