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
constint 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!!!!!!!
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.