Which will probably be never.

You are viewing a single thread.
View all comments View context
7 points

Except that this is wrong. C is free to do all kinds of things you didn’t ask it to, and will often initialize your variables without you writing it.

permalink
report
parent
reply
1 point

Machine code would be a better example of what he’s talking about imo. Not an expert or anything of course.

permalink
report
parent
reply
3 points

Odds are that your computer doesn’t export any language where it will do exactly as you say (amd64 machine code certainly won’t execute exactly as written). And how much difference it makes varies from one language to another.

But the specific example from the OP, of uninitialized variables, is one of those cases where the C spec famously goes completely out of line and says your code can do whatever, run with a random value, fail, initialize it, format your hard drive, make a transaction on your bank account… whatever.

permalink
report
parent
reply
2 points

Coding in C but if I don’t initialize a Variable the compiler formats my drive! (Not Clickbait)

permalink
report
parent
reply

Programmer Humor

!programmer_humor@programming.dev

Create post

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

Community stats

  • 3.7K

    Monthly active users

  • 811

    Posts

  • 13K

    Comments