Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Doesnt it fuck shit up bc its "clear" on unix, "cls" on windows and "fuckmeimrich" on mac?
-
@BindView
Well that can b taken care of by macros to distinguish envs...
And as for “fuckmeimrich”
Come on... Mac OS is a pretty decent OS... π π ππ -
Umm...
Now I feel so stupid π¨π¨π¨π¨
I deallocated memory before using the variable which caused those seg faults... not because of system()...
Although it is interesting to note that program didn’t seg fault when there was no system() call π€π€π€
No idea....
Well that’s why I love C ππ
Related Rants
Today’s lesson in C programming:
DON’T use
system( “clear” );
in Mac OS...
Causes seg Fault in ur program when it is perfectly correct...
What happened was... a friend wanted help with C programming and had written this code... but it was getting seg Fault randomly... just random seg Fault when his code was correct...
I pinpointed the seg Fault to a printf statement but the statement was correct...
Off to search the issue I went, found out that flushing problems can occur in printf if u don’t use \n.
This happens randomly. Thought this might b the reason...
Went to a VM running Arch Linux and tested the code there... worked perfectly. No issues whatsoever.
From a distant memory I remembered some people discussing to never use system( “clear” ); since it causes issues.
Thought to remove that line from code, thinking it wouldn’t make any difference.
Well imagine my shock when the code worked fine after remove that freaking line...
M gonna blame this one on Mac OS since arch had no issues with it π‘π‘
Now to find alternative to system( “clear” );
Damm it I spent 4-5 hours on this crap!!!!!!
rant
why πππ
c
mac os
system( βclearβ );