a vector question
-
Hi, I am declaring a std::vector vX. I am filling it up using vX.push_back(aNum). The problem is i want to put the contents of vX into DP which is defined as double DP[]; This is because an external routine requires an array that is of the form above. Any ideas would be appreciated. Thanks Kash
-
Hi, I am declaring a std::vector vX. I am filling it up using vX.push_back(aNum). The problem is i want to put the contents of vX into DP which is defined as double DP[]; This is because an external routine requires an array that is of the form above. Any ideas would be appreciated. Thanks Kash
Hi Kash, IIRC, vector is guaranteed to be continuous (its the only container with the guarantee). So you should be able to return the address of element 0 - &vX[0]. Is vX declared as follows? std::vector vX; Please correct me if I am wrong. Jeff