본문 바로가기
[IT] C언어 입문(5) Operators, 연산자 - 논리연산자, 단축평가, 대입연산자, if문 및 while문 활용 □ 연산자 * Logical Operators - !, ||, && - logical_expression ::= logical_negation_expr | logical_or_expr | logical_and_expr - logical_negation_expr ::= !expr (not) - logical_or_expr ::= expr || expr (or) - logical_and_expr ::= expr && expr (and) - The result is 0 or 1 (int) - ex) (804; // b=00000000 - shift operator는 2, 4, 8, 16 ... 을 곱하는 효과가 있음 * Compound assignment operators - " +=, -=, *=, /=, .. 2021. 8. 22.
[IT] C언어 입문(4) Operators, 연산자 - scanf, 산술연산자, 관계연산자, 증감연산자, 대입연산자, 동등연산자 등 □ 기본연산자 * scanf - Analogous to printf, but used for input - scanf is passed a list arguments, control_string and other arguments - other arguments : addresses - ex) scanf("%d", &x); => &x : the address of x, The format %d is matched with &x - When reading numbers, it skips white space (blanks, newlines, and tabs) but when reading in a character white space is not skipped. c : Character d : Decim.. 2021. 8. 21.
[IT] C언어 입문(3) Data types, 데이터 타입(자료형) □ data types * Suffixes(접미사) for Data Type : int - int long, unsigned long - U or u : unsigned, ex) 25U, 0x32u - L or l : long, ex) 37L, 0x27L - UL or ul : unsigned long, 56uL, 234UL * Floating types - Variables of this type hold real values - float : 4bytes, 6 decimal places - double : 8bytes, 15 decimal places - long double : 12bytes, the compiler may provide more storage than double * Suffixe.. 2021. 8. 20.
[IT] C언어 입문(2) Variables - 변수, 대입연산자, 구문규칙, 데이터타입 등 □ Variables and data type * Computing - By human : Needs a pencil, a piece of paper Following a sequence of computing steps(procedural) Recoding the intermediate results on the paper(imperative) - C is an imperative and procedural language : Specifies explicit manipulation of the state of the computer system (imperative) Specifies an explicit sequence of steps to perform (procedural) * Variables.. 2021. 8. 17.
[IT] C언어 입문(1) Introduction - C언어의 역사와 기본 개념 □ The basics of C Programming Language * Programming Languages - Communication method between human and computers - Low-level programming languages : Assembly, Machine-oriented - High-level programming languages : C, Java, Basic, Pascal, Human-oriented * History of C - 1972 : Dennis Ritchie designed C, PDP-11 computer, AT&T Bell Lab - 1973 : Most of the Unix kernel was rewritten in C (예전에는 Assem.. 2021. 8. 16.