structs and arrays and functions

Hello everyone I hope all is well, im having some problems that im hoping someone can help me with im beginning c++ and I am working on a problem that wants me to build a struct.....
1
2
3
4
5
6
struct Bank
{
	int accountnum;
	double accountBal;
	double interest;
};

ok thats done next i have to build a function
1
2
3
4
void enterAccountData()
{
Other code here........
}


and so in main i have

1
2
3
4
const int SIZE = 5;
Bank myAccount[SIZE];

enterAccountData();


now what i need to do is pass the myAccount[SIZE] up to the function the book is no help......
I have tryed declaring my function like....
void enterAccountData(int myAccount, int size){}
And
enterAccountdata(myAccount[], SIZE);
in main()


im about to give up on arrays all together and use vectors I have seemed to have better luck with those

any help would be great and THANK YOU VERY MUCH!!!!!!!
enterAccountdata(myAccount, SIZE); //just remove the []

I'd use vectors normally...but you should probably use arrays at least once just to know how they work.
Don't give up on arrays. That's stupid.

I'm not completely sure about this answer, so somebody correct me if i'm wrong, but I think you want to

enterAccountdata(myaccount); //function call

//function defenition
void enterAccountdata(Bank* myAccount);

So you'll be passing a pointer to the first variable in an array to the function.
Again, I'm somewhat of a newbie in C++, but i'm fairly certain this is correct.
Wow thanks for the fast reply and you guys are life savers i can finally move on with my life thank you very much
Topic archived. No new replies allowed.