2011-09-01 55 views
-3

请告诉我,如果有,当我调用这些函数我是否正确调用这些函数?

1布尔折扣任何错误(浮动价,诠释numberOfItemsPurchased)

bool discount 
float price; 
int numberOfItemPurchased; 

discount = discountP (price, numberOfItemPurchased) 

2浮estimatePetrolPrice(浮公里,浮动价格,布尔含铅,布尔自动)

float estimatePrice; 
float kms; 
float price; 
bool leaded; 
bool automatic; 

estimatePrice = estimatePetrolPrice (kms, price, leaded, automatic) 

3空隙的getData(串&名,字符串&出生日期,诠释&岁)

string name; 
string dateOfBirth; 
int age; 

getData (name, dateOfBirth, age) 

4无效GETVAL(INT &项目,诠释&间,焦炭decflag)

int item; 
int inter; 
char decflag; 

getVal (item, inter, decflag) 
+0

对不起,这是一个编程问题?你的代码是什么? –

+0

这里的实际*问题*是什么? – Puppy

回答

1

是的,这是正确的。您传递与函数声明中声明的类型相同的参数,并将返回值分配给正确类型的变量(如果它不是void)。