だから、私はこの構造体を持っています:
typedef struct {
int day;
int amount;
char type[4],desc[20];
}transaction;
そして、mainで宣言されたタイプtransactionのベクトルを設定するこの関数:
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:");
}
}
関数のヘッダーで発生するエラーtransact()
:
Multiple markers at this line
- Syntax error
- expected ';', ',' or ')' before '&' token