我是否正确调用了这些函数

Am I calling these functions correctly?

本文关键字:函数 调用 是否      更新时间:2023-10-16

请告诉我当我调用这些函数时是否有任何错误

1 bool折扣(float price, int numberofitemspurpurchase)

bool discount
float price;
int numberOfItemPurchased;
discount = discountP (price, numberOfItemPurchased)

2 float estimatepetroprice(浮动公里,浮动价格,bool领先,bool自动)

float estimatePrice;
float kms;
float price;
bool leaded;
bool automatic;
estimatePrice = estimatePetrolPrice (kms, price, leaded, automatic)

3 void getData (string &名称,字符串&出生日期;年龄)

string name;
string dateOfBirth;
int age;
getData (name, dateOfBirth, age)

4 void getVal (int &Item, int &

int item;
int inter;
char decflag;
getVal (item, inter, decflag)

是的。传递与函数声明类型相同的参数,如果返回值不是void,则将返回值赋给正确类型的变量。