Using auto with a class type - C++ Data Type

C++ examples for Data Type:auto

Description

Using auto with a class type

Demo Code

#include <iostream>
#include <typeinfo>

using namespace std;

class MyClass//from  w  w  w . j  a va2 s. c  om
{
};

int main()
{
    auto variable = MyClass();
    cout << "Type of variable: " << typeid(variable).name() << endl;

    return 0;
}

Result


Related Tutorials