Thread: int overflow

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    -bleh-
    Join Date
    Aug 2010
    Location
    somewhere in this universe
    Posts
    463

    int overflow

    Hi,
    This just pops into my head when I tried to generate a large array to be used as an example for my sorting algorithm. Is there a way to catch integer overflow in a loop? or is it better to use unsigned int when you think the for loop will be long? I know it's unlikely for me to use all the int, but it's interesting to see how it's done.
    Last edited by nimitzhunter; 12-11-2010 at 08:48 PM.
    "All that we see or seem
    Is but a dream within a dream." - Poe

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Formatting Issue?
    By matthewlane in forum C Programming
    Replies: 1
    Last Post: 11-15-2010, 05:55 PM
  2. Producer/Consumer - problems creating threads
    By hansel13 in forum C Programming
    Replies: 47
    Last Post: 08-20-2010, 02:02 PM
  3. Working with random like dice
    By SebastionV3 in forum C++ Programming
    Replies: 10
    Last Post: 05-26-2006, 09:16 PM
  4. Replies: 2
    Last Post: 03-24-2006, 08:36 PM
  5. Half-life SDK, where are the constants?
    By bennyandthejets in forum Game Programming
    Replies: 29
    Last Post: 08-25-2003, 11:58 AM