📄 functions.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 + -