Simple Explanation Please

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
YAH NO ONE REPLIED :(((((((((
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
Thx so got muddled up cus they used = as well as () thx so much
Topic archived. No new replies allowed.