Kernel and the C

2022. 4. 22. 23:34Coding - C

Kernel is the foundation of the computer, core of the computer program, the basic of every program. Everything else, including many programs and codes, runs on the top of it. The language C is close to the computer system as it is very much used for the kernel.

 

C is very close to the computer, so it is hard to learn for humans. These types of coding languages are called low-level languages. The other way around, which means languages that are easy for humans to learn and hard for the computer to understand, like python, is called high-level languages. Technically, C has the characteristics of both high-level and low level languages. However, it is closer to the low level language. 

 

 

Procedure-Oriented VS Object-Oriented

C is specifically a procedure-oriented (순서적) programming language.  So basically line by line, C must be run from the top to bottom, just once.

 

The antonym for procedure-oriented is object-oriented programming language (객체지향). Some examples of object-oriented languages are python and java. They run based on the object and the result. So unlike procedure-oriented languages, it has priotity on result that humans want more over procedure. 

 

 

 

C's Pros are that the program written in C is very easy to move to other hardware. It is also simple, fast, and small in size because it is concise. 

 

The Cons of C's are that they are hard to learn. The 시스템 자원(Ex. Memory, etc.) is very hard to control. The 시스템 자원 are things we can restrict and do everything, so we can execute very complex system with this. As a result, it is very important to pay close attention to it.

 

 

 

C Running Order Source: http://www.tcpschool.com/c/c_intro_programming

C running order follows specific sequence. The reason why we do gcc -o file file.c is because gcc means complier, -o means output, asking the computer to translate to binary notation. Then, We do /file to tell the computer to tell to run the code after they translate it. Then the computer executes the code. *Just as a reminder, semicolons tells the computer that this line of code stopped here. 

 

 

C Escape Sequence List: http://www.tcpschool.com/c/c_intro_programming

There are escape sequence, which are special characters, and gives special effects on the result. The reason we put %d is to format the code to integers: %d = format specifier. The “&”, such as “&a” , tells the inputter data to be recorded to the specific variable already set. To be simple, the “&” tells the address(주소) of the variable 

 

 

 

There are also many different data types, that have similar functions but differences such as float and double, which only has decimal palces difference. As a extension, we are going to focus on constant.  Constant, unlike variables, are data that can’t be changed until the code in full run. We use the keyword const. Ex) Const int x = 6;

 

There are two types of constant, the Literal constant, which is the number, character, and many other things we just use instantly. There is also Symbolic constant: things that we declare right away

 

'Coding - C' 카테고리의 다른 글

Control Flow Statement  (0) 2022.05.13
Data Types and Operators  (0) 2022.05.07
Binary Notation & Conversion, Bits and Bytes  (0) 2022.04.15
C Foundation Review  (0) 2022.04.08
Interpreter VS Complier  (0) 2022.04.01