본문 바로가기

카테고리 없음

[C++]함수 기초 예제

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <iostream>
using namespace std;
 
int three()
{
   return 3;
}
 
int main()
{
  int ret;
  ret = three();
  cout << "ret = " << ret << "\n" ;
 
  return 0;
}
cs


three 라는 함수를 생성 후 반환값을 출력하는 예제