Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
C Programming- Calling elements in Arrays question.
#7
That's not the way to do it.

If i is getting negative values (though I don't see anything in your code snippet that would make it do so), you must find out where and prevent it there. Otherwise, how do you know that when i is -5 it's really supposed to be 5? Maybe it should be forced to 3? Or 100?

Debug your program. With a debugger if you know how to use it (recommended) or by debug messages (printing out where you are and what the values of relevant variables are).

First question I'd ask about this code snippet is "what is the value of ntime?"
Reply


Messages In This Thread
C Programming- Calling elements in Arrays question. - by SaptaZapta - 2013-04-03, 01:19 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)