612
submitted 4 months ago by Zerush@lemmy.ml to c/memes@lemmy.ml
you are viewing a single comment's thread
view the rest of the comments
[-] PM_ME_VINTAGE_30S@lemmy.sdf.org 2 points 4 months ago* (last edited 4 months ago)

Well I just tried #define int void in C and C++ before a "hello world" program. C++ catches it because main() has to be an int, but C doesn't care. I think it is because C just treats main() as an int by default; older books on C don't even include the "int" part of "int main()" because it's not strictly necessary.

#define int void replaces all ints with type void, which is typically used to write functions with no return value.

this post was submitted on 12 May 2024
612 points (94.0% liked)

Memes

45275 readers
2094 users here now

Rules:

  1. Be civil and nice.
  2. Try not to excessively repost, as a rule of thumb, wait at least 2 months to do it if you have to.

founded 5 years ago
MODERATORS