Am trying to test this new 'auto' feature on C++11 version.
Here is my problem:
^ santos@santos-HCL-ME-Laptop:~/c++$ cat ./First_go.cpp
#include <iostream>
int main(int argC, char* argV[]){
auto i = 10.25 ;
std::cout<<"i after using auto"<<i<<std::endl ;
return 0 ;
} santos@santos-HCL-ME-Laptop:~/c++$ g++ --version
g++ (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
santos@santos-HCL-ME-Laptop:~/c++$ g++ First_go.cpp
First_go.cpp: In function ‘int main(int, char**)’:
First_go.cpp:5:8: error: ‘i’ does not name a type
auto i = 10.25 ;
^
First_go.cpp:6:36: error: ‘i’ was not declared in this scope
std::cout<<"i after using auto"<<i<<std::endl ;
Seems like my g++ version supports this C++11 auto feature, am not sure whatz wrong, appreciate any help :)