accessing vector objects via a pointer

I have a pointer to a vector of objects, each object has an array and a couple of strings.
I am unsure how to access the data in the objects via the pointer.
1
2
3
4
5
6
Best tree::chooseSplit(vector <pgm> *ptr)
{
	Best splits;
	cout<<ptr[1].filePath;  //not working!!!
	
}



filepath is a string in the pgm object.
i also need to be able to access elements in an array that also exists in pgm.
Any help will be greatly appreciated.

ptr is a pointer to a vector, so you'll need to do something like:
(*ptr)[1].filePath
Cheers, that's sorted me out.
Topic archived. No new replies allowed.