I am a C programmer. I am working on a C++ code and translating it into C.
I got stuck in a point where I do not understand what is going on.
I would kindly ask if you would mine help me to understand these problems.
I have three problems:
1)There are two arrays with different length:
vector<double> D;
double temp[5];
//and then:
D.resize(3, temp);
Does the programmer wants to copy temp[0], temp[1], and temp[2] into D[0], D[1], and D[2] ?
2)There is a two dimensional array
vector<vector<double> > F;
it is initialized like this:
F.resize(3, temp);
Since temp[5] is a one dimensional array, is it possible to copy it into a two dimensional array?
Finally array F which is a two dimensional array is passed as a one dimensional array into a function like this:
//declaration of function
void do(vector<double> & F);
main(){
// now F which is sopposed to be a two dimensional array is used like
for(int I; i<3; i++) do(F[i]); // !!!!!!!!!!!!!
}
In C it is not possible as far as my knowledge. Is this possible in C++?
Thanks in advance for your kind help.