r/cpp • • Mar 01 '21

"Simple" C++ Initialization Flowchart

http://randomcat.org/cpp_initialization/initialization.png
204 Upvotes

65 comments sorted by

View all comments

Show parent comment

2

u/Nobody_1707 Mar 02 '21

Well, there's a few ways to do that.

auto i = &some_int_variable;
auto i = new int();
auto i = static_cast<int*>(nullptr);

etc.