18#include <console-util.h>
43int main(
int argc,
char *argv[])
49 fprintf(stderr,
"Usage: %s <arg1> <arg2> <arg3>\n", argv[0]);
54 if (argv[2][0] == 0x00 || argv[2][1] != 0x00)
56 fprintf(stderr,
"Usage: %s <arg1> <arg2> <arg3>\n", argv[0]);
61 int arg1 = atoi(argv[1]);
62 int arg3 = atoi(argv[3]);
81 fprintf(stderr,
"Usage: %s <num1> <+|-|x|/> <num2>\n", argv[0]);
89 fprintf(stderr,
"Error: calcHandler failed\n");
94 printf(
"%d\n", result);
int main(int argc, char *argv[])
プログラムのエントリーポイント。
計算ライブラリ (動的リンク用) のヘッダーファイル。
CALC_EXPORT int CALC_API calcHandler(const int kind, const int a, const int b, int *result)
指定された演算種別に基づいて計算を実行します。
#define CALC_KIND_MULTIPLY
乗算の演算種別を表す定数。
#define CALC_KIND_SUBTRACT
減算の演算種別を表す定数。
#define CALC_KIND_DIVIDE
除算の演算種別を表す定数。
#define CALC_KIND_ADD
加算の演算種別を表す定数。