Pricefield | Lemmy
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
@[email protected] to Programmer [email protected] • 5 months ago

unsafeCode

lemmy.ml

message-square
20
fedilink
  • cross-posted to:
  • [email protected]
388

unsafeCode

lemmy.ml

@[email protected] to Programmer [email protected] • 5 months ago
message-square
20
fedilink
  • cross-posted to:
  • [email protected]
  • @[email protected]
    link
    fedilink
    34•
    edit-2
    5 months ago

    Any void main(){...} enjoyers?

    • @[email protected]
      link
      fedilink
      1•5 months ago

      int main(void) { . . . } for me!

    • stebo
      link
      fedilink
      9•5 months ago

      besides not requiring a return value, what difference does it make?

      • Oriel Jutty :hhHHHAAAH:
        link
        fedilink
        9•5 months ago

        @stebo02 @Bogus5553 Neither of them require a return value, but void main isn’t legal C++.

        • stebo
          link
          fedilink
          2•5 months ago

          yeah I thought so, does it work in C?

          • @[email protected]
            link
            fedilink
            4•
            edit-2
            5 months ago

            void main(){...} is not in the standard, but works on both MSVC and GCC (with warnings). I think it works on both C/C++, but you really shouldn’t use it in production. Just use int main(void){...} , without any return value, which is permitted in the standard, and will return success iirc.

      • @[email protected]
        link
        fedilink
        2•5 months ago

        It will also give an error if you try to add a return value anyways.

    • @[email protected]
      link
      fedilink
      5•5 months ago

      while (true) {...}

Programmer [email protected]

[email protected]
Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: [email protected]

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

  • Posts must be relevant to programming, programmers, or computer science.
  • No NSFW content.
  • Jokes must be in good taste. No hate speech, bigotry, etc.
  • 18 users / day
  • 68 users / week
  • 467 users / month
  • 1.54K users / 6 months
  • 4 subscribers
  • 1.82K Posts
  • 38.6K Comments
  • Modlog
  • mods:
  • @[email protected]
  • @[email protected]
  • UI: 0.18.4
  • BE: 0.18.2
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org