MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/cpp/comments/lvhvgz/simple_c_initialization_flowchart/gpflk29/?context=3
r/cpp • u/konanTheBarbar • Mar 01 '21
65 comments sorted by
View all comments
103
I prefer it as a table.
8 u/Ayjayz Mar 02 '21 Strange that its missing the one we're being told to use now, auto i = Type{x};I guess that's just the 4th row, kind of? Which seems to be the one with the most green ticks anyway. 2 u/martinus int main(){[]()[[]]{{}}();} Mar 02 '21 I love that format and use it almost everywhere. Actually I'm using auto i = Type(x). My only issues is how do I create a pointer that way? E.g. i want to create an int*. 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.
8
Strange that its missing the one we're being told to use now, auto i = Type{x};
auto i = Type{x};
I guess that's just the 4th row, kind of? Which seems to be the one with the most green ticks anyway.
2 u/martinus int main(){[]()[[]]{{}}();} Mar 02 '21 I love that format and use it almost everywhere. Actually I'm using auto i = Type(x). My only issues is how do I create a pointer that way? E.g. i want to create an int*. 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.
2
I love that format and use it almost everywhere. Actually I'm using auto i = Type(x). My only issues is how do I create a pointer that way? E.g. i want to create an int*.
auto i = Type(x)
int*
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.
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.
103
u/atimholt Mar 01 '21
I prefer it as a table.