Journal

By Steve Challis

Recent Entries

Archive

RSS/Atom

Home

Projects

Basic Fail #1

February 8th, 2010 — 0 Comments — Permalink

  • fail
  • c
for (int t; t<n; t++) {
    ...
}

... Forgetting to initialise the variable in a for loop.

In the above example, if t is not initialised to anything then the program will still compile and run, but display odd behaviour. I seem to be doing this a lot recently - it can be tricky to track down and just infuriated me for half an hour. Oops.


This post will expire in 0 minutes

Discussion

There are no comments for this post.

Leave A Reply

You may use Markdown syntax but raw HTML will be escaped and headings normalised.

Log in

Powered by Mumblr – a basic Django tumblelog application that uses MongoDB with MongoEngine. Fork it on Github. Designed and developed by Harry Marr and Steve Challis.

Unless otherwise noted, everything here is available under the Creative Commons Attribution-Share Alike 3.0 license. Sharing is fucking cool.

Home / Projects / Recent / Archive / RSS /