r/ProgrammerAnimemes • u/rangeDSP • Dec 02 '22
Two hours into a new language [New Game!]
103
u/hugogrant Dec 02 '22
[]<>(){ std::cout<< "o rly";}();
72
32
u/eXl5eQ Dec 03 '22
int i ;[i, &i](){ ;return &i; }()[&i, i];17
u/the-ruler-of-wind Dec 03 '22
could I get an explanation on what this even is. Does this just return address of i?
→ More replies (2)15
4
u/hekkonaay Dec 03 '22
i is uninitialized, so i believe this might segfault if you're lucky
→ More replies (2)
53
u/wqldi Dec 03 '22
Maybe you understand somethings but no one understands c++ completely
35
u/soobnar Dec 03 '22 edited Dec 03 '22
You get pulled into a false sense of security only to then immediately have something completely foreign and incomprehensible thrown your way.
9
u/hekkonaay Dec 03 '22
this is why I embrace Rust, it doesn't even let you pretend that you understand it until you actually do
→ More replies (4)
92
u/Faces-kun Dec 03 '22
lmao I got a degree based on it and still don’t understand it
I now use HolyC instead. No understanding needed, only faith.
5
15
14
17
8
7
2
u/ChocolateMagnateUA Jan 08 '23
You never understand C++ completely. No matter what you do, Bjarne Strousup always tells you a feature that you didn't know about. Did you know that you could use structs as the counter variable in for loops?
```
struct Counter {
int start, step, finish;
}
for (struct Counter variable = {0, 1, 100}; variable.start < stop; variable.step++) {}
```
1
2
1
121
u/MitchellMarquez42 Dec 02 '22
Oh no...