본문 바로가기
C

C Programming: Basic structure for Beginners / C언어 기본 구조

by 재르미온느 2024. 3. 12.

I suddenly have to learn C programming for my "Basic Algorithm" class!  I haven't taken the prerequisite courses for this course, but I have taught myself the necessary material out of necessity and eagerness to learn.

기초 알고리즘 수업 덕에 갑자기 C언어를 공부하게 되었다. 선수과목 이수를 안했기 때문에 필수적인 내용은 독학해야한다.

 

Today, we will explore the basic structure of the C language.

오늘은 C언어의 간단한 기본 구조에 대해 설명하고자 한다.

#include <iostream>

int main()
{
	int a = 2, b = 3, value;
	value = Sum(a, b);
	printf("%d", value);
}
  • #include <header file>: preprocessor directive.
    • stdio.h : C
    • iostream : C++
  •  ; (semicolon) : Indicating the end of a command.
  • main() : main function
    • int main() : the function will return an integer value.
    • void main() : the function doesn't explicitly return any value.
  • int a,b,value; : defining an Integer Variable
  • printf( format specifier, value)
    • format specifier
      • %d : integer
      • %c : character
      • %f : float
      • %s : string

 

In the next post, we will study the concept of pointers in C. I hope you found this post helpful :)

다음 포스팅에서는 포인터 개념까지 간단히 설명할 예정이다.