A
AnuSree
hi
am getting error when am trying to type cast.is it possible to type
cast from one type of vector to another type.is there any other way
other than overloading.my peice of code in which am getting error is.
Here is my peice of code.
_____________________
vector<Varbind> varbinds;
vector<NameValuePair> nameValuePairs;
if(varbinds.size()!=0) {
for(int index = 0;index<varbinds.size();++index) {
nameValuePairs.push_back(varbinds[index]);
}
}
here i have to cast the type of varbinds from type vector<Varbinds> to
the type vector<NameValuePair>
And the second query is
______________________
it is also with push_back.Here is the peice of code
vector<NameValuePair> ar = req.arr();
VarbindList varbinds;
for ( int i = 0; i < ar.size(); ++i ) {
varbinds.push_back(ar); //Error Here
}
Here varbinds is the object of the class VarbindList and ar is of
type vector<NameValuePair>.I have to cast vector<NameValuePairs> to the
type VarbindList.
Please help me in this to aspects ASAP.
am getting error when am trying to type cast.is it possible to type
cast from one type of vector to another type.is there any other way
other than overloading.my peice of code in which am getting error is.
Here is my peice of code.
_____________________
vector<Varbind> varbinds;
vector<NameValuePair> nameValuePairs;
if(varbinds.size()!=0) {
for(int index = 0;index<varbinds.size();++index) {
nameValuePairs.push_back(varbinds[index]);
}
}
here i have to cast the type of varbinds from type vector<Varbinds> to
the type vector<NameValuePair>
And the second query is
______________________
it is also with push_back.Here is the peice of code
vector<NameValuePair> ar = req.arr();
VarbindList varbinds;
for ( int i = 0; i < ar.size(); ++i ) {
varbinds.push_back(ar); //Error Here
}
Here varbinds is the object of the class VarbindList and ar is of
type vector<NameValuePair>.I have to cast vector<NameValuePairs> to the
type VarbindList.
Please help me in this to aspects ASAP.