본문 바로가기

카테고리 없음

overloading

#include "stdafx.h"

#include <iostream>

#include <string>


using namespace std;


void Print(const char *str, bool endl) {

cout << str;


if (endl) cout << std::endl;


return;


}


void Print(const char*str) {

cout << str;


return;


}


int main(void) {

int num = 0;


Print("한 개의 정수를 입력하십시요 : ");

cin >> num;


Print("입력하신 정수는 ");

cout << num;

Print("입니다.", true);

return 0;


}