C++ Auto-Type

Beispiel

string func() {
return string(„this is a string“);
}

int main( int argc, char ** argv ) {
auto x = func();
printf(„x is %s\n“, x.c_str());
printf(„type of x is %s\n“, typeid(x).name());
return 0;
}

Schreibe einen Kommentar