找到好工作,生活才快乐。要开始找工作了,复习下C++。
Book: Essential C++
(1)不加using namespace std;的后果是什么?
basicio.cpp:24: error: ‘string’ was not declared in this scope
basicio.cpp:26: error: ‘cout’ was not declared in this scope
basicio.cpp:26: error: ‘endl’ was not declared in this scope
(2)C++中如何进行变量初始化?
(3)class string的初始化方式有哪些?
(4)记忆<<, >>流操作符的方法
按照常规的口语顺序,“左右”,“读写”,顺序对应,左对应读,右对应写。
(5) C++中的=赋值背后的内涵
1. 简单赋值
2. 隐式自动调用copy constructor
3.
(6) C++中的==在不同情况下表示的含义
(7) vector的初始化
必须是已存在的元素才能用下标操作符进行索引。通过下标操作进行赋值时,不会添加任何元素。
(8) const二三事
// 语法上没有任何问题,但是const修饰符的目的是说成员变量在val()函数内不可以修改,那么一般来说,val()返回的_val也不应该能够被修改。由于函数前没有const修饰,所以_val实际上向外部开放了。
MyClass & val() const
{
return _val;
}
// 正确的写法:
const MyClass & val() const
{
return _val;
}
// 最完美的定义方法:
class val_class{
const MyClass & val() const {return _val;}
MyClass &val(){ return _val; }
};
void sample(const val_class *pbc, val_class &rbc)
{
pbc->val(); // 调用const版
rbc.val(); //调用non-const版
}
利用mutable修饰符,可以突破const的不可修改限制。例如mutable int _next;
(9)后置++重载的特殊性
为了和前置++加以区别,后置++的重载声明就行了一些变通,参数表中加入了一个冗余的int,实属特例:
inline MyObject & operator++(int){}
(10)
分享到:
相关推荐
mit job hunting collections
貌似是老外的一些找工作建议,希望对大家有用
Here are good answers to some of the tougher questions asked in job interviews. If you can smoothly supply answers like these during the interview, you are bound to make a good impression.
想找一个好工作?不知道丰富哪些技能?面试很头疼?看了这本书,你会豁然开朗。不过,你需要英文好。这是英文版。去Google, Facebook, Tiwtter就靠它了。
中职英语下册 unit Job HuntingPPT课件.pptx
(第二次课)Unit 1 Job-hunting(2022级人工智能班).zip
Helpful for Job finding purposes
hunting security bugs chm格式 经典书籍,希望对你有帮助
Microsoft.Press.Hunting.Security.Bugs chm Microsoft.Press.Hunting.Security.Bugs chm
Bug Bounty Hunting for Web Security Bug Bounty Hunting for Web Security Bug Bounty Hunting for Web Security Bug Bounty Hunting for Web Security
Offering practical advice, hands-on guidance and code samples, this essential guide will help you to find, classify, and assess security bugs before your software is released.
preparation-for-job-hunting 求职准备
小软件 hunting for living 用c++ 编写 ,运行在 vc++6.0环境中
藏经阁-1BIG GAME THEORY HUNTING.pdf
Finally, learn how to set yourself up for job hunting success with trusted and supportive guidance on creating a winning resume, gaining attention with your cover letter, following up after an ...
Hunting Security Bug 随书的示例和代码,有几个缓冲区溢出的很有意思。
2021年求职 这是记录我2021年全职求职过程的存储库
Multi-AUV Hunting Algorithm Based on Bio-inspired Neural Network in Unknown