Thread: Infinite loop!!!

  1. #1
    Registered User
    Join Date
    Nov 2007
    Posts
    26

    Infinite loop!!!

    Hi, I have a problem with a program I am writing in C using the Dev-C++ compiler. One of my functions called crtTable seems to be getting stuck in an infinite loop. Whenever it is called in main the program just sits at it. All my code is too much to post here so here's a link to the .c file and the input file which are both required to compile.

    project2.c : http://www.box.net/shared/4qbmika1k8
    input.txt : http://www.box.net/shared/c1ao7j9zmf

    There's a good amount of loops in crtTable and I'm not exactly sure what could be causing it. If you could take a look at it I would be very grateful.

  2. #2
    Registered User
    Join Date
    May 2008
    Posts
    25
    Could try putting printf("debug(Number)"); in each loop to see which ones causing it.

  3. #3
    Registered User
    Join Date
    Nov 2007
    Posts
    26
    Thanks I'm going to give that a try. But now after looking through everything I'm not even sure that it is getting stuck in a loop. That's what it looks like but I don't see anything wrong in the parameters of the for's and while's.

  4. #4
    Registered User
    Join Date
    Nov 2007
    Posts
    26
    Ok I found the problem. Thanks for looking at it.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 06-14-2009, 11:24 PM
  2. Cosine fucntion and infinite loop.
    By youareafever in forum C Programming
    Replies: 2
    Last Post: 11-07-2008, 04:45 AM
  3. Infinite Loop with GetAsyncKeyState
    By guitarist809 in forum Windows Programming
    Replies: 1
    Last Post: 04-18-2008, 12:09 PM
  4. Switch statement = infinite loop
    By Lucid003 in forum C++ Programming
    Replies: 10
    Last Post: 10-10-2005, 12:46 AM
  5. stays in loop, but it's not an infinite loop (C++)
    By Berticus in forum C++ Programming
    Replies: 8
    Last Post: 07-19-2005, 11:17 AM