标签:cross return std int 定义 height round 声明 调用函数
1 #include <iostream> 2 using namespace std; 3 double func(double a = 555) 4 { 5 cout << a <<endl; 6 return a; 7 } 8 int main() 9 { 10 func(); 11 return 0; 12 }
1 string screenInit(string::size_type height = 24, 2 string::size_type width = 80, 3 char background = ‘ ‘ ); 4 5 string screen; 6 screen = screenInit(); // equivalent to screenInit (24,80,‘‘) 7 screen = screenInit(66); // equivalent to screenInit (66,80,‘‘) 8 screen = screenInit(66, 256); // screenInit(66,256,‘ ‘) 9 screen = screenInit(66, 256, ‘#‘);
1 #include <iostream> 2 using namespace std; 3 size_t count_calls() 4 { 5 static size_t ctr = 0; // value will persist across calls 6 return ++ctr; 7 } 8 int main() 9 { 10 for (size_t i = 0; i != 10; ++i) 11 cout << count_calls() << endl; 12 return 0; 13 }
标签:cross return std int 定义 height round 声明 调用函数
原文地址:https://www.cnblogs.com/2020R/p/13178309.html