If I have a struct like
struct account {
int account_number;
};
Then what\'s the difference between doing
myAccount.acco
You use the different notation according to whether the left-hand side is a object or a pointer.
// correct:
struct account myAccount;
myAccount.account_number;
// also correct:
struct account* pMyAccount;
pMyAccount->account_number;
// also, also correct
(*pMyAccount).account_number;
// incorrect:
myAccount->account_number;
pMyAccount.account_number;