• 请不要在回答技术问题时复制粘贴 AI 生成的内容
from0toheroC
V2EX  ›  程序员

新手求教C++小问题

  •  
  •   from0toheroC · Feb 23, 2013 · 3218 views
    This topic created in 4859 days ago, the information mentioned may be changed or developed.
    #include <string>
    std::string titleA = "Initializing a new string.";
    // 这里定义了titleA,并初始化“In...”。

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

    不知这种理解对吗?
    2 replies    1970-01-01 08:00:00 +08:00
    Channing
        1
    Channing  
       Feb 23, 2013
    laskuma
        2
    laskuma  
       Feb 23, 2013
    楼上正解
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2801 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 54ms · UTC 04:19 · PVG 12:19 · LAX 21:19 · JFK 00:19
    ♥ Do have faith in what you're doing.