오토 auto
auto 타입
실습 예제
ch05ex3_auto.cpp
#include <iostream>
using std::cout;
using std::cin;
using std::endl;
int main()
{
auto v1 = 3;
auto v2 = 3.14;
auto v3 = 'T';
// auto v4; error
cout << "v1: " << v1 << ", type: " << typeid(v1).name() << endl;
cout << "v2: " << v2 << ", type: " << typeid(v2).name() << endl;
cout << "v3: " << v3 << ", type: " << typeid(v3).name() << endl;
return 0;
}Last updated