V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
from0toheroC
V2EX  ›  程序员

新手求教C++小问题

  •  
  •   from0toheroC · 2013-02-23 01:27:12 +08:00 · 2656 次点击
    这是一个创建于 4052 天前的主题,其中的信息可能已经有所发展或是发生改变。
    #include <string>
    std::string titleA = "Initializing a new string.";
    // 这里定义了titleA,并初始化“In...”。

    我的理解是,先调用default constructor生成一个empty string,然后调用operator=赋值。

    不知这种理解对吗?
    2 条回复    1970-01-01 08:00:00 +08:00
    Channing
        1
    Channing  
       2013-02-23 01:44:18 +08:00
    laskuma
        2
    laskuma  
       2013-02-23 02:52:51 +08:00
    楼上正解
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5256 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 07:23 · PVG 15:23 · LAX 00:23 · JFK 03:23
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.