hi im writing a program that need the condition of the do... while loop to be a for loop.
well at least thats what i think i need .
the format is i have a class and made an array of objects(h[])
Code:
do
{
for (i=0;i<total;i++)
{
while (h[i].product<AccumNum)
{
h[i].num1++;
h[i].product=num1*num2;
AccumNum=AccumNum+h[i].num1;
}//first while brace
}//for brace
}//do brace
while (for (i=0;i<total;1++){h[i].product<AccumNum;})
the array size of h is user defined in an int named total.
the members of the class are float num1, num2 and sum
is it possible to use a for loop as the while loops condition
edit... sorry i forgot to say the perpouse of these loop is to check that all product=more than the total accumnum
so if i have 3 sums
say product 1 is 3*4=12
product2 is 6*4=24
product 3 is 7*4=28
so if accum number was made to 12 then it would all be valid
but if accum number was say 30 then none would be valid so it would have to loop again
making product1 3*5
product2 6*5
product3 7*5
my example sum are not true to a proper value but thats the idea of the loop