Essential C++ Reading Notes

Chapter1

P6, 1.2 Why //#include<string> we still can use "string user_name"?

-->ctrl+left mouse on the string of "string user_name", you can find string defined in "stringfwd.h"

     ctrl+left mouse on std of "using namespace std", you can find std include "stringfwd.h"

Note1: cout<<"enter...\n";  equal to cout<<"endter..."<<endl;

P7, 1.3 if change main to my_main(), what will happen?

-->ld error, undefined 'main' in function '_start'

Note2: don't forget "constructor syntax" for initialization, example: int age(10); it works not only for class.

Note3: C++11 ubuntu eclipse support: https://blog.lutty.me/code/2015-02/eclipse-enable-cpp11.html

Note4: C++11 编译断言(编译到这里时报错):static_assert

 

posted on 2019-09-19 20:56  Felizño  阅读(128)  评论(0编辑  收藏  举报

导航