dormi.zone
  • Communities
  • Create Post
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
@PandaDEV@lemmy.ml to Programmer Humor@lemmy.ml • 3 months ago

unsafeCode

lemmy.ml

message-square
18
fedilink
  • cross-posted to:
  • programmer_humor@programming.dev
391

unsafeCode

lemmy.ml

@PandaDEV@lemmy.ml to Programmer Humor@lemmy.ml • 3 months ago
message-square
18
fedilink
  • cross-posted to:
  • programmer_humor@programming.dev
  • @lily33@lemm.ee
    link
    fedilink
    44•
    edit-2
    3 months ago

    That is why I use just int main(){...} without arguments instead.

    • @Bogus5553@lemm.ee
      link
      fedilink
      35•
      edit-2
      3 months ago

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

      • @stebo02@lemmy.dbzer0.com
        link
        fedilink
        8•
        edit-2
        9 days ago

        deleted by creator

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

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

          • @stebo02@lemmy.dbzer0.com
            link
            fedilink
            2•
            edit-2
            9 days ago

            deleted by creator

            • @Bogus5553@lemm.ee
              link
              fedilink
              4•
              edit-2
              3 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.

        • @Buddahriffic@lemmy.world
          link
          fedilink
          2•3 months ago

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

      • @Thorry84@feddit.nl
        link
        fedilink
        4•3 months ago

        while (true) {...}

      • @CausticFlames@sopuli.xyz
        link
        fedilink
        1•3 months ago

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

    • CptKrkIsClmbngThMntn [any]
      link
      fedilink
      English
      4•3 months ago

      Very true, the less user input you have the safer your code will be.

Programmer Humor@lemmy.ml

!programmerhumor@lemmy.ml

Subscribe from Remote Instance

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: !programmerhumor@lemmy.ml

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.
  • 1.3K users / day
  • 1.66K users / week
  • 2.38K users / month
  • 10.2K users / 6 months
  • 35.6K subscribers
  • 1.71K Posts
  • 37.6K Comments
  • Modlog
  • mods:
  • @AgreeableLandscape@lemmy.ml
  • @cat_programmer@lemmy.ml
  • BE: 0.19.3
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org