USSTRocketry / MiniRockets

Making rockets that hopefully go UP!
MIT License
2 stars 11 forks source link

C lib in c++ code #20

Closed snowy-shadow closed 1 year ago

snowy-shadow commented 2 years ago

When including C libs in c++, add prefix c and remove .h

e.g. #include <cstdlib> instead of #include <stdlib.h>

this applies for all c libs

frroossst commented 1 year ago

Can you link me some resources as to why is preferable. (just to document the reasons)

snowy-shadow commented 1 year ago

"the proper way" because everything is now wrapped in the namespace std https://www.incredibuild.com/blog/cstdlib-in-c-explained

stdlib.h is deprecated since 1998 https://stackoverflow.com/questions/2900785/whats-the-difference-between-cstdlib-and-stdlib-h

for our case I don't think it will matter that much tho

frroossst commented 1 year ago

Thanks! :+1:

Edit: I'm keeping this open, will use the issue to onboard new members