⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 functions.cpp

📁 c++最经典的入门书籍
💻 CPP
字号:
// functions.cpp

//#define TESTFUNCTION              // Uncomment to get trace output

#ifdef TESTFUNCTION
#include <iostream>               // Only required for trace output
#endif

#include "functions.h"

// Definition of the function sum
int fun::sum(int x, int y) {
  #ifdef TESTFUNCTION
  std::cout << "Function sum called." << std::endl;
  #endif

  return x+y;
}

// Definition of the function product
int fun::product(int x, int y) {
  #ifdef TESTFUNCTION
  std::cout << "Function product called." << std::endl;
  #endif

  return x*y;
}

// Definition of the function difference
int fun::difference(int x, int y) {
  #ifdef TESTFUNCTION
  std::cout << "Function difference called." << std::endl;
  #endif

  return x-y;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -