반응형
C언어의 hello world 출력 코드는 아래와 같다.
#include <stdio.h>
int main()
{
printf("Hello World");
return 0;
}
C++의 출력코드는 아래와 같다.
#include <iostream>
int main()
{
std::cout<<"Hello World";
return 0;
}
표준 라이브러리인 iostream 선언 시 확장자 .h 는 생략하는 것이 약속이다. printf 대신 std::cout<< 을 사용한다.
반응형
'C++ > 출력' 카테고리의 다른 글
[C++] 원하는 문자 출력하는 방법 (cout) (0) | 2022.08.10 |
---|
댓글