DEV Community

Discussion on: A new Way to assign variable in Cpp 10

Collapse
 
selectiveduplicate profile image
Abu Sakib

Yeah it was introduced I think in C++17. It's called constructor initialization (named after how variables are initialized in class constructors). Another way is uniform initialization: int a {10};. Both of these ways can be combined with the old way: int a = (10) and int a = {10}.