首页
注册
登录
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请
登录
V2EX
›
程序员
新手求教C++小问题
from0toheroC
·
2013-02-23 01:27:12 +08:00
· 2752 次点击
这是一个创建于 4242 天前的主题,其中的信息可能已经有所发展或是发生改变。
#include <string>
std::string titleA = "Initializing a new string.";
// 这里定义了titleA,并初始化“In...”。
我的理解是,先调用default constructor生成一个empty string,然后调用operator=赋值。
不知这种理解对吗?
string
titleA
调用
2 条回复
•
1970-01-01 08:00:00 +08:00
1
Channing
2013-02-23 01:44:18 +08:00
不对。直接调用conversion constructor。
http://www.keithschwarz.com/cs106l/spring2009/handouts/220_Conversion_Constructors.pdf
2
laskuma
2013-02-23 02:52:51 +08:00
楼上正解
关于
·
帮助文档
·
博客
·
API
·
FAQ
·
实用小工具
·
1845 人在线
最高记录 6679
·
Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 25ms ·
UTC 04:54
·
PVG 12:54
·
LAX 21:54
·
JFK 00:54
Developed with
CodeLauncher
♥ Do have faith in what you're doing.