//默认参数要指定放在右边 1 #include <iostream> 2 #include <cstdarg> 3 using namespace std; 4 5 int add(int a,int b,int c = 1) 6 { 7 return a + b + c; 8 } 9 10 void main() 11 { 12 cout << add(1, 2); 13 14 }
原文地址:https://www.cnblogs.com/xiaochi/p/8543509.html
时间: 2024-11-08 13:28:50