tucson.social
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
cm0002@lemmy.world to Programmer Humor@programming.dev · 3 months ago

unsafeCode

lemmy.ml

message-square
13
link
fedilink
  • cross-posted to:
  • [email protected]
245

unsafeCode

lemmy.ml

cm0002@lemmy.world to Programmer Humor@programming.dev · 3 months ago
message-square
13
link
fedilink
  • cross-posted to:
  • [email protected]
  • Lucy :3@feddit.org
    link
    fedilink
    arrow-up
    25
    ·
    3 months ago

    Should return 0;.

    • Kwdg@discuss.tchncs.de
      link
      fedilink
      arrow-up
      27
      ·
      3 months ago

      Not needed, main in C++ implicitly returns 0 if there is no return

      • Lucy :3@feddit.org
        link
        fedilink
        arrow-up
        9
        ·
        3 months ago

        Should ≠ Needs to

        You can do it, and it will work, but it’s unclean and not best-practice. I wouldn’t be surprised if it’s undefined behaviour.

        • xmunk@sh.itjust.works
          link
          fedilink
          arrow-up
          22
          ·
          3 months ago

          Just to clarify. It is defined behavior - there’s plenty of undefined behavior in C but that ain’t one of them.

    • esa@discuss.tchncs.de
      link
      fedilink
      arrow-up
      22
      ·
      3 months ago

      >What is C++? A miserable huge pile of "should"s

      • shotgun_crab@lemmy.world
        link
        fedilink
        arrow-up
        8
        ·
        3 months ago

        Love me some Castlevania++

      • riodoro1@lemmy.world
        link
        fedilink
        arrow-up
        2
        ·
        3 months ago

        should have a space after „>” and two new lines after „?”.

        I guess markdown is miserable as well.

        • kboy101222@sh.itjust.works
          link
          fedilink
          English
          arrow-up
          5
          ·
          3 months ago

          Hey now, markdown serves it’s purpose. It’s not great, but as a web dev, I don’t want people expecting full WYSIWYG editors in every website cause fuck that!

        • Colonel Panic@programming.dev
          link
          fedilink
          arrow-up
          3
          ·
          3 months ago

          not being able to master markdown might hint at why the commenter is struggling with C++

      • Lucy :3@feddit.org
        link
        fedilink
        arrow-up
        1
        ·
        edit-2
        3 months ago

        Still love it tho. You can make it whatever you want!

Programmer Humor@programming.dev

programmer_humor@programming.dev

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: [email protected]

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics
Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 1.03K users / day
  • 4.42K users / week
  • 8.94K users / month
  • 17.1K users / 6 months
  • 1 local subscriber
  • 23.1K subscribers
  • 1.37K Posts
  • 44.2K Comments
  • Modlog
  • mods:
  • Feyter@programming.dev
  • adr1an@programming.dev
  • BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne@programming.dev
  • BE: 0.19.11
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org