MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/shittyprogramming/comments/1h24v2d/fun_with_memory/
r/shittyprogramming • u/Powerkaninchen • Nov 28 '24
12 comments sorted by
5
It's wild that you can allocate memory without doing anything with the result.
9 u/Powerkaninchen Nov 29 '24 it even compiles with -Wall -Wextra -Werror -pedantic 6 u/F54280 Nov 29 '24 /uj in reality there is no allocation.But C++ is exceptionally fast at doing nothing, so it doesn’t matter!
9
it even compiles with -Wall -Wextra -Werror -pedantic
-Wall -Wextra -Werror -pedantic
6
/uj in reality there is no allocation.
But C++ is exceptionally fast at doing nothing, so it doesn’t matter!
16
Is this the Google Chrome source code?
2
I loathe your editor theme
1
In the second loop, memory is allocated using new but never deallocated using delete[]. It will probably result in memory leaks 😢 Use std::unique_ptr to manage dynamic memory
0
I'm also in the cannabis Thailand sub, title works as pseudocode.
-10
C++ is indeed shitty programming 🤮
4 u/aallfik11 Dec 01 '24 You can write shitty code in any language -1 u/anominous27 Dec 02 '24 And you can write good code in any language (except C++ 🤮)
4
You can write shitty code in any language
-1 u/anominous27 Dec 02 '24 And you can write good code in any language (except C++ 🤮)
-1
And you can write good code in any language (except C++ 🤮)
15
Am I a pervert or is this a sex joke?
8 u/ztexxmee Nov 29 '24 nah definitely a sex joke
8
nah definitely a sex joke
5
u/bubbaholy Nov 29 '24
It's wild that you can allocate memory without doing anything with the result.
16
u/ducuduck Nov 29 '24
Is this the Google Chrome source code?
2
u/k_means_clusterfuck Nov 29 '24
I loathe your editor theme
1
u/Hecatoncheires_1 Dec 01 '24
In the second loop, memory is allocated using new but never deallocated using delete[]. It will probably result in memory leaks 😢 Use std::unique_ptr to manage dynamic memory
0
u/ForthOfHors Nov 29 '24
I'm also in the cannabis Thailand sub, title works as pseudocode.
-10
u/anominous27 Nov 29 '24
C++ is indeed shitty programming 🤮
15
u/fuzz3289 Nov 29 '24
Am I a pervert or is this a sex joke?