function returns 0, pls help
for (i=a; i==i-1440;i--)This loop will never be executed, not even once, because the condition
i==i-1440
will evaluate to false already before the first iteration. It will always be false. You should read the manual about how the for() loop works, what its three arguments mean and how it is used.
Your loop code looks strange: for (i=a; i==i-1440;i--) //try this one : int basis(int a) { int i; for (i=a; i<limit;i++) { if (TimeToStr(Time[i], TIME_MINUTES) == ex_time) break; } return (i); }
thanks 7bit and sergery. I've adjusted it and it works fine now.