Simple Explanation Please

Jun 14, 2014 at 6:46pm
So basically i want to know:
const std::string greeting = "Hello, " + name + "!";
const std::string spaces(greeting.size(), ' ');
in this code why is spaces in () why cant we just do a =
from the book im reading it dosent explain it propely and says that it is constucted instead of insitazed please can someone help me
Jun 16, 2014 at 8:35pm
YAH NO ONE REPLIED :(((((((((
Jun 17, 2014 at 5:19am
YAH NO ONE REPLIED :(((((((((

That happens occasionally.


const std::string spaces(greeting.size(), ' ');
in this code why is spaces in () why cant we just do a =

What would you put on the right side of the = sign?


from the book im reading it dosent explain it propely and says that it is constucted instead of insitazed please can someone help me

Construction is initialization.

Last edited on Jun 17, 2014 at 5:19am
Jun 26, 2014 at 4:07pm
Thx so got muddled up cus they used = as well as () thx so much
Topic archived. No new replies allowed.