In article <b2************************@posting.google.com>,
everett <ev************@mol-son.com> wrote:
How do you increment a variable name in loop.
You can't.
For example I have a
variable K1 and I want to increment the name by one everytime I go
through the loop to K2, K3, K4 and so on. Thanks.
Why not use an array, or better, a vector?
vector<double> K(10);
for (int pos = 0; pos < 10; ++pos)
{
// do something with K[pos]
}
--
Jon Bell <jt*******@presby.edu> Presbyterian College
Dept. of Physics and Computer Science Clinton, South Carolina USA