A
Allerdyce.John
Hi,
How can I Random access an element in a STL List if I have a pointer to
that list?
I know how to do that if I have a reference to a STL list, but how can
I do that if I have a pointer to a STL List.
void function (vector<int>& myLIst) {
// access the first element of myList
printf ("%d", myList[1]);
}
but if I have this:
void function (vector<int>* myLIst) {
// how to access the first element of myList
printf ("%d", myList[1]);
}
Thank you.
How can I Random access an element in a STL List if I have a pointer to
that list?
I know how to do that if I have a reference to a STL list, but how can
I do that if I have a pointer to a STL List.
void function (vector<int>& myLIst) {
// access the first element of myList
printf ("%d", myList[1]);
}
but if I have this:
void function (vector<int>* myLIst) {
// how to access the first element of myList
printf ("%d", myList[1]);
}
Thank you.