cout, cin, endl 이해하기


cout, cin, endl 이해하기

※이거를 보기 위해선 우선 연산자 오버로딩부터 확인하는 것이 좋다. Colored By Color Scripter 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 #include <stdio.h> namespace mystd{ char* endl="\n"; class ostream{ public: ostream& operator<<(char *str){ printf("%s", str); return *this; } ostream& operator<<(int i){ printf("%d", i); return *this; } ostream& operator<<(double i){ printf("%e", i); return *this; } }; ostream cout; } using mystd::cout; using mystd::endl; int main(){ cout<<"Hello World"<<...



원문링크 : cout, cin, endl 이해하기