Samathy is a user on You can follow them or interact with them if you have an account anywhere in the fediverse. If you don't, you can sign up here.
Samathy @samathy

Today I Learned: It is valid C to declare the types of a function's arguments after the function definition.

Not just valid, but this is how defining a function is described in K&R's The C Programming Language!

· Web · 0 · 0

@samathy omg let's not encourage people to use k&r notation!!! 🙃

When I was picking up c in highschool, my teacher still taught both variants, and it was incredibly confusing as to why he would always point to k&r as an aside. I figure he imagined that we'd have to read legacy code some day in our careers. Little did he know that software developers would prefer to reinvent the wheel thanks to the "made here first" mentality ;)