Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Problem: passing a vector of struct by reference

$
0
0
Hi!

I would like to use my vector in a function but the function caller shows that there is a problem. I don´t really know how I can fix this. Thanks for any idea.

Declaration of struct and vector:
struct Person
{
	string sign;
	string firstName;
	string lastName;
	double height;
};

vector<Person> persons;



Functionsprototyp:
void getName(Person[]);


Functionsdefinition:
void getName(Person persons[])
{

...

}


Function caller:
getName(persons);


Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>