C++11:Auto

Auto

Auto关键字用于定义,不能用于声明

 

auto AddTest(int a, int b)

{

  return a+b;

}

 

int main()

{

  auto index = 10;

  auto str = "abc";

  auto ret = AddTest(1, 2);

}

 

 

 

 

posted @ 2023-06-20 15:21  言午丶  阅读(11)  评论(0)    收藏  举报