Quote:Original post by Ben2k
I don't really blame you Emmanuel, do you know when I left school? I studied statistics and graduated 7years ago. I pray I don't come across people like you.
What, people who want to make sure it's not a homework question before they give out the answer?
What is wrong with that? Perhaps you should just relax a little and not take it as an insult. On this forum there is an official policy not to do people's homework.
So when in doubt, people ask if it is homework.
If it isn't, there's no problem. But if it is, people should figure it out for themselves, which means all we can provide here are hints, not complete answers/explanations.
So, since it isn't a homework question, I'll try to help. (That is, I'll try to ask some clarifying questions because I can't really make sense of the question)
Quote:I want to use column variable names of an array
This bit puzzles me a bit.
Elements in an array don't have names. That's pretty much the point. They have an integer index in the array, but no name.
So how do you mean red, blue and green are the names of the columns?
If you have something like this:
int red = 0;int green = 1;int blue = 2;
Then if you have a two-dimensional array, you can refer to one column like this:
array[red], which would get you an array containing all the red values. Is this what you mean?
How is the array declared, and how are the columns "named"?
You then want to be able to enter an expression like this:
red+blue*green, where red, blue and green are all arrays. (This is all C/C++ code, right, and not a just a string containing the expression?)
And the output should then give you one string of the form:
"r0+g0*b0" where what, r0,g0,b0 are the first items in each column? Or should the string contain something like this for every item in the column (something like "r0+g0*b0 r1+g1*b1 r2+g2*b2")?
It'd be really helpful if you could explain exactly what it is you want the code to do. (Perhaps even what you need it for)
Try writing up some code for how you'd want to use it, or something.