-
auto s = "abcd"
creatsconst char *
not string, so useauto
with caution. -
Since a string in C++ is an array of chars, you can operate it like an array. For example, you can use range-based for loop and so on.
-
It is recommended that you use
std::string
in …
Make Eclipse Support C++11
-
Make a new C++ project
-
Default options for everything
-
Once created, right-click the project and go to "Properties"
-
C/C++ Build -> Settings -> Tool Settings -> GCC C++ Compiler -> Miscellaneous -> Other Flags. Put -std=c++0x at the end.
-
C++ General -> Paths and Symbols -> Symbols -> GNU C++. Click "Add..." and paste
__GXX_EXPERIMENTAL_CXX0X__ …