Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!samsung!olivea!tardis!tymix!uunet!mcsun!ukc!edcastle!cs.ed.ac.uk!scm From: scm@cs.ed.ac.uk (Santa C Maria) Newsgroups: comp.lang.c Subject: How to implement these loops ... Message-ID: <12844@skye.cs.ed.ac.uk> Date: 20 Jun 91 10:21:11 GMT Sender: nnews@cs.ed.ac.uk Reply-To: scm@lfcs.ed.ac.uk (Santa C Maria) Lines: 19 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.