C Program ±¸Á¶
- FunctionµéÀÇ ÁýÇÕ - FunctionµéÁß Çϳª´Â "main"À̶ó´Â
À̸§À» °¡Á®¾ß ÇÔ
- °¢ functionÀº statement(¹®)µé·Î ±¸¼º
- ÀÔÃâ·Â¹®, Á¶°Ç¹®, ¹Ýº¹¹®, ÁöÁ¤¹®, ¼±¾ð¹®, ¼±Åù®, ºÐ±â¹®
#include <Çì´õÈÀÏ(ÈÀϸí.h)>
#include "Çì´õÈÀÏ(ÈÀϸí.h)"
/* < >¿Í " "ÀÇ ´Ù¸¥Á¡Àº Çì´õÈÀÏÀÌ ÀÖ´Â °÷ÀÇ µð·ºÅ丮
#¼±Çà󸮱â // ÁÖ·Î #define¹®ÀÌ ¾²ÀÓ
main() // ÁÖÇÔ¼ö: ÇÁ·Î±×·¥ÀÇ ½ÇÇàÀÌ ½ÃÀ۵Ǵ °÷
{ /* ÇÔ¼öÀÇ ½ÃÀÛÀ» ³ªÅ¸³¿ */
¹® (statement)
:
:
} /* ÇÔ¼öÀÇ ³¡À» ³ªÅ¸³¿ */
ÇÔ¼ö¸í() /* »ç¿ëÀÚ°¡ ÀÛ¼ºÇÑ ÇÔ¼öµé..*/
{
¹®(statement)
:
}
ÇÔ¼ö¸í() /* ¿©·¯ °³ÀÇ ÇÔ¼ö¸¦ °è¼Ó ¸¸µé¾î ¾µ ¼ö ÀÖ´Ù. */
:
Statement(¹®)ÀÇ ±¸¼º
Keyword or Reserved word, Identifier, Constant, String, Operator
Keywords or Reserved Words : ƯÁ¤ ¸ñÀû¿¡ »ç¿ëµÇ´Â
¿¹¾à¾î
- ÀÚ·á¼±¾ð: void, char, int, float, long, double, short, signed,
unsigned, const, struct, union, enum, typedef
- ±â¾ïÀ¯Çü: auto, extern, register, static, volatile
- Á¦¾î: if, else, for, while, do, switch, case, default, continue,
break, return, goto, sizeof
- Identifier (½Äº°¾î)
- ÇÁ·Î±×·¡¸Ó°¡ ÇÊ¿ä¿¡ µû¶ó Á¤ÇÑ À̸§. ¿µ¹®ÀÚ, ¼ýÀÚ, _ µîÀÇ °áÇÕÀ¸·Î
¸¸µé¸ç ¹Ýµå½Ã ¿µ¹®ÀÚ³ª _(Underscore)·Î ½ÃÀÛÇÏ¿©¾ß ÇÔ. ÇÔ¼ö¸í,
º¯¼ö¸í µî¿¡ »ç¿ë. ±â¾ïÇϱ⠽±°í ÀÚ·áÇü¿¡ ¾Ë¸Â´Â À̸§À» »ç¿ëÇÏ¿©¾ß
ÇÑ´Ù.
- Operator (¿¬»êÀÚ)
- ¿¬»ê¿¡ ÇÊ¿äÇÑ Æ¯¼ö ±âÈ£µé. +, -, *, /, %
- String (¹®ÀÚ¿)
- "(ÀÌÁß µû¿ÈÇ¥)" ³»¿¡ ÀÖ´Â ¹®ÀÚ¿
- Constant (»ó¼ö)
- Á¤¼öÇü »ó¼ö, ½Ç¼öÇü »ó¼ö, ¹®ÀÚ »ó¼ö
- Comments (ÁÖ¼®¹®)
- /* ¿Í */ »çÀÌ¿¡ ÀÖ´Â ¸ðµç ¹®ÀÚ¿ ¶Ç´Â //·Î ½ÃÀÛµÇ¾î ±× ÁÙÀÌ
³¡³ª´Â °÷±îÁöÀÇ ¸ðµç ¹®ÀÚ¿. ¸í·ÉÀÇ ÀϺΰ¡ ¾Æ´Ï¸ç (ÄÄÆÄÀÏ·¯´Â
¹«½Ã) ÇÁ·Î±×·¥ ¼³¸í¿¡ »ç¿ë
[ Table Of Contents |
Previous Chapter |
Next Chapter]