I started learning c++ . Can anyone explain in detail how these initialization options differ? When what is called, etc.?
Type x = smth ; Type x (smth); Type x = {smth}; Type x {smth}; Type x = (smth); I started learning c++ . Can anyone explain in detail how these initialization options differ? When what is called, etc.?
Type x = smth ; Type x (smth); Type x = {smth}; Type x {smth}; Type x = (smth); Foreigners had a discussion here. Initialization difference with or without Curly braces in C ++ 11
In short, initialization {} will not allow us to perform "narrowing" transformations. That is, you can not assign int thus char
char i ={22} - the assignment of int to char is done here. I understand what you had in mind, but in the current wording this is not entirely correct. - ixSciSource: https://ru.stackoverflow.com/questions/584534/
All Articles