??? 09/28/04 12:00 Read: times |
#78259 - RE: Programming style Responding to: ???'s previous message |
Are you sure that the first part of your program will count as a decade counter ? When a digit reaches 9, it is changed to 0 before increment ?
Also the programming style is not to be proud of. I would suggest the following: i=0; counted_pulses[i]++; while ((counted_pulses[i]>=10)&&i<4) { counted_pulses[i]=0; i++; counted_pulses[i]++; }It's shorter and more clear. It's made for 4 digits, 0 is the lowest. (I haven't tried the program). Regards, Slobodan |