So, I have this struct:
typedef struct {
int day;
int amount;
char type[4],desc[20];
}transaction;
And this function to populate a vector of type transaction ,declared in main:
void transact(transaction t[],int &n)
{
for(int i=0;i<n;i++)
{
t[i].day=GetNumber("Give the day:");
t[i].amount=GetNumber("Give the amount of money:");
t[i].type=GetNumber("Give the transaction type:");
t[i].desc=GetNumber("Give the descripition:");
}
}
The error I get at the header of the function transact():
Multiple markers at this line
- Syntax error
- expected ';', ',' or ')' before '&' token
t[i].type = GetNumber("...")andt[i].desc = ....