I have an array, b[10];
i would like to add up all the values in that array and store the answer as wt.

any help?

Recommended Answers

All 3 Replies

Could we see some code...Your array, what type is it?

Sorry, iv done it anyway :) just did it the long way
e.g wt = (bt[0] + bt[1] etc....

going to use a for loop to cut it down though

thanks anyway

Could we see some code...Your array, what type is it?

1) Do you know how to access the elements in the array
2) Do you know how to use a for loop
3) Do you know how to use add a value

If so then you know how to do it,
else ask about a even more specific question.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.