Mar 11, 2012 at 6:33pm UTC
Thanks for help really! but I'm not sure what you mean by bold things you put ?
If I remove Edi , Pdi it does remove the error "Warning : Statement with no effect" on both of the loops .
When it comes to the preprocessor constant List on Line 1 my goal was to put a value that would change in a instance.
Line 6 Pdi is the value the user puts in at start of program and its compared to PRODUCTS the second for loop
Line 8
CompanyDisplayAmount [Edi][Pdi] = CompanyOweMoneyArray [Edi][Pdi]+ ProductsValue[Pdi];
Goal was to add the arrays as variables
Total[r][c] = array 1 [r][c ] + array 2 (from predefine table)
since array are variables just with more memory locations.
Just showing you my thought process
Hmmm...
When I put a printf statement within the nested for loop it doesn't show either .
When I look at this statement closely
CompanyDisplayAmount [Edi][Pdi] = CompanyOweMoneyArray [Edi][Pdi]+ ProductsValue[Pdi];
Are you trying to say where is it being stored ?
I just thought it was a valid statement
example
CompanyDisplayAmount [0][1] = CompanyOweMoneyArray [0][1]+ ProductsValue[1];
20 = 0 + 20 ;
next round
CompanyDisplayAmount [0][1] = CompanyOweMoneyArray [0][1]+ ProductsValue[1];
40 = 20 + 20 ;
I cant see the issue :/
Mar 12, 2012 at 5:35am UTC
Sorry, I was very lazy with my reply.
ProductsValue
is an array of 5 values and has indices 0, 1, 2, 3, 4. The inner for loop increments Pdi
while it is less than 6. When Pdi == 5, ProductsValue[Pdi]
will cause an out of range runtime error.