How to implement these loops ...
Santa C Maria
scm at cs.ed.ac.uk
Thu Jun 20 20:21:11 AEST 1991
This is probably a rather silly question. I would be glad, if you
can give me a hint. I want to implement a number of loops in this
manner:
for ( i[0] = 0; i[0] < x[0]; ++i[0] ) {
for ( i[1] = 0; i[1] < x[1]; ++i[1] ) {
......
......
for ( i[m-1] = 0; i[m-1] < x[m-1]; ++i[m-1] ) {
do_something_here();
}
......
}
}
do_something_here() is thus executed x[0]*[x[1]* ... *x[m-1] times.
The problem is that m, x[0], ... x[m-1] all depend upon run-time
values. The question is how do I code this?
Thanks in advance for your help.
More information about the Comp.lang.c
mailing list