Return Type Deduction in C++11 - C++ Data Type

C++ examples for Data Type:auto

Description

Return Type Deduction in C++11

Demo Code

#include <iostream>

using namespace std;

auto AutoFunctionFromReturn(int parameter) -> int
{
    return parameter;
}

int main()//from   w  ww . j a v  a2 s. c o  m
{
    auto value = AutoFunctionFromReturn(1);
    cout << value << endl;

    return 0;
}

Result


Related Tutorials