[C++] c++ 内联函数 →→→→→进入此内容的聊天室

来自 , 2019-08-07, 写在 C++, 查看 99 次.
URL http://www.code666.cn/view/728f206c
  1. #include <iostream>
  2.  
  3. inline int Double(int);
  4.  
  5. int main() {
  6.         int target;
  7.         using std::cout;
  8.         using std::cin;
  9.         using std::endl;
  10.  
  11.         cout << "Enter a number to work with: ";
  12.         cin >> target;
  13.         cout << "\n";
  14.  
  15.         target = Double(target);
  16.         cout << "Target: " << target << endl;
  17.  
  18.         target = Double(target);
  19.         cout << "Target: " << target << endl;
  20.  
  21.         target = Double(target);
  22.         cout << "Target: " << target << endl;
  23.         return 0;
  24. }
  25.  
  26. int Double(int target) {
  27.         return 2 * target;
  28. }
  29.  

回复 "c++ 内联函数"

这儿你可以回复上面这条便签

captcha