我还想再挣扎会:
Think C 3.9
parameters and arguments
some of the built-in functions we have used have parameters, which are values that you provide to let the function do its job. For example, if you want to find the sine of a number, you have to
indicate what the number is. Thus, sin() takes a double value as a parameter
然后举了一个例子:
void PrintTwice (char phil)
{
printf("%c%c\n, phil, phil);
}
phil 是一个parameter,是char 类型
另外一个例子:
int main (void)
{
PrintTwice('a');
return EXIT_SUCCESS;
}
The char value you provide is called an argument,
and we say that the argument is passed to the function.
'a'是一个argument , 被递给了PrintTwice(),执行PrintTwice这个功能(打印出两次)
那我能不能总结成:
1.
第二段:some of the built-in functions have paremeters, which are values that you provide to
let the function do its job
所以parameter 存在于 function ,以及 parameter也是value吗?
2.在定义(?我也不知道准确来说是不是定义?)PrintTwice的时候,在括号里面的是parameter和它的type
在main里面调用PrintTwice这一个function的时候,括号里面的是argument
所以如果一个程序没有调用function的话就不会有argument和parameter
上面的两点可以这么总结吗??