Pricefield | Lemmy
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
Albin Jose to [email protected] • 2 years ago

What will happen if we put a semi-colon after a for loop in C++?

message-square
14
fedilink
18
message-square

What will happen if we put a semi-colon after a for loop in C++?

Albin Jose to [email protected] • 2 years ago
message-square
14
fedilink
  • @[email protected]
    link
    fedilink
    11•2 years ago

    The loop will run to completion with no side effects. Unless it gets optimized away by the compiler or CPU.

    • @[email protected]
      link
      fedilink
      9•2 years ago

      Now slap some commas in there and you can have side effects in the loop header.

      Guaranteed to confuse :)

    • @[email protected]
      link
      fedilink
      3•2 years ago

      It’s actually ub, so it could also find the cure to cancer

[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]

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person’s post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you’re posting long videos try to add in some form of tldr for those who don’t want to watch videos

Wormhole

Follow the wormhole through a path of communities [email protected]



  • 35 users / day
  • 114 users / week
  • 380 users / month
  • 1.8K users / 6 months
  • 3 subscribers
  • 2.34K Posts
  • 35K Comments
  • Modlog
  • mods:
  • snowe
  • Ategon
  • @[email protected]
  • @[email protected]
  • UI: 0.18.4
  • BE: 0.18.2
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org