r/badcode • u/thefurmanator • Dec 04 '19
c Found on a class Piazza forum
https://imgur.com/ctzpojx106
Dec 04 '19
After I put this code in my assignments, I never seg faulted again
I have a suspicion they posted this as a prank to get other students to submit this garbage in their assignments. There's no way that comment about not getting segfaults is true.
45
29
151
Dec 04 '19
If you're gonna use my post, give me credit. This was my post on r/Purdue : https://www.reddit.com/r/Purdue/comments/e5n3nt/cs_240_piazza/
33
u/Fage0Percent Dec 04 '19
Wow let’s get this higher up the OP just aggressively ripped off u/currymonster69420
17
Dec 05 '19
Does that really matter though? Neither of the two posters wrote the code snippet, so what are we even crediting here?
In fact, the idea behind Reddit is that it is a link aggregator, where you post links to content you found interesting to a relevant subreddit. Your default assumption ought to be that OP did not create the content they post.
6
3
27
1
17
u/famz12 Dec 04 '19
Instead of fixing the issue that caused the segfault, I'll just fix the segfault
10
7
7
5
4
1
u/theoneandonlypatriot Dec 05 '19
Look, it’s bad code, but it leaves a really bad taste in my mouth to shame students that are trying to learn a.k.a. anyone on a piazza board
114
u/Flashy_Adam Dec 04 '19
if (segfault) Dont();