C++ Primer Exercise 5.18
来源:互联网 发布:java汽车销售管理系统 编辑:程序博客网 时间:2024/05/16 05:01
Understanduing the difference between C++ and C# therefore know the computer language deeper.
vector<string*> svec;
string line;
while(getline(cin,line))
{
//1)Instead, the new expression returns a pointer to the newly allocated objects.
string *sp= new string(line);
svec.push_back(sp);
}
// 2) understanding the iterator which use the composition not the inhertiance to solve the traverse problem to any container.
vector<string*>::iterator ster = svec.begin();
while (ster != svec.end())
{
cout <<**ster<<" "<<(**ster).size() << endl;
ster++;
}
//3) delete the allocated storage in heap
ster = svec.begin();
while (ster != svec.end())
{
delete *ster;
ster++;
}
return 0;
//Following is the result.
- C++ Primer Exercise 5.18
- C++primer 5th exercise section 12.1.6 答案
- c++ primer Exercise 5.0
- C primer plus(5th edit) program exercise 7-6(统计ei occurs)
- C++ Primer, 5th Edition Exercise CH1
- C++ Primer, 5th Edition Exercise CH2
- C程序设计语言 Exercise 2-9
- C程序设计语言 Exercise 2-10
- C程序设计语言 Exercise 3-1
- C++primer
- 《C++primer》
- C++primer
- C++primer
- C++Primer
- C++ primer English fourth edition exercise page 301
- C++ primer English Fourth edition P322 Exercise 9.18
- Solution for Exercise 4.33 of C++ Primer 5th Edition.
- Exercise
- MySql 远程登录,用户创建,数据库创建及授权。
- 浩哥小议网页布局
- 博客迁移
- swf文件二进制数据流加密基础
- 银行业务调度系统
- C++ Primer Exercise 5.18
- 网站从业人员必读:有关HTML5的流言与真相
- 工作流-jBPM开发经历1
- c++ 转换与继承
- 大数据处理利器——Bloom Filter(布隆过滤器)要点分析
- WinCE6.0 USB Host驱动加载流程详解(二)
- OAF MVC Architecture
- 牛人主页(主页有很多论文代码)
- 【第一章】 Spring概述 ——跟我学Spring3