초보 개발자의 기록

[C] C program language 101 본문

카테고리 없음

[C] C program language 101

bambinodeveloper 2023. 9. 9. 05:10
728x90

#include <stdio.h>

header file library. Header files add functionality to C programs

 

White space

C ignores white space.

multiple lines makes the code more readable.

 

main()

main() is called a function. Any code inside its curly brackets {} will be executed

 

Esxape sequence

New lines \n

It forces the cursor to change its positio to the beginning of the next line on the screen.

To insert a new line, use the \n character

\n\n will create a blank line

 

other Escape sequence

\t : create a horizontal tab

\\ : Inserts a backslash character(\)

\" : Inserts a double quote character

 

printf()

It does not insert a new line at the end of the output

printf() is a function used to outputprint text to the screen. 

Every C statement ends with a semicolon ;

Normally other languages use a print function to display the value of a variable but, not possible in C.

 

Comments

Coments can be used to explain code, and to make it more readable

It can also be used to prevent execution when testing alternative code.

 

- Single-line Comments

two forward slashes //

text between // and the end ot the line is ignored by the compiler ( will not be executed)

 

-Multi-line comments

Start with /* and ends with */

728x90
반응형