1 #include<iostream>
2 using namespace std;
3 int tes(int a);
4 int main()
5 {
6 int m=1;
7 cout<<tes(m)<<endl;
8
9 return 1;
10 }
11 int tes(int _a)
12 {
13 cout<<"this is a test."<<endl;
14 return c;
15 }

不明白为什么函数tes的声明和定义中参数不同,分别为a和_a。因为一直以来传递参数的样子都是一样的。后来才发现,参数长什么样只是一个形式,不但可以换为_a还可以是b,c。都没有关系。

相关文章:

  • 2022-02-21
  • 2021-08-15
  • 2021-07-28
  • 2022-01-01
  • 2021-11-28
  • 2021-10-30
  • 2021-06-17
  • 2021-07-29
猜你喜欢
  • 2021-05-19
  • 2021-05-31
  • 2022-12-23
  • 2021-07-13
  • 2021-10-01
  • 2021-10-02
  • 2022-12-23
相关资源
相似解决方案