Document of c-modernization-kit (calc) 1.0.0
Loading...
Searching...
No Matches
shared-and-static-calc.c File Reference

動的リンク、静的リンクを使った関数の呼び出しコマンド。 More...

#include <libcalc.h>
#include <libcalcbase.h>
#include <console-util.h>
#include <stdio.h>
#include <stdlib.h>
Include dependency graph for shared-and-static-calc.c:

Go to the source code of this file.

Functions

int main (int argc, char *argv[])
 プログラムのエントリーポイント。

Detailed Description

動的リンク、静的リンクを使った関数の呼び出しコマンド。

Author
c-modenization-kit sample team
Date
2025/11/22
Version
1.0.0

コマンドライン引数から 2 つの整数を受け取り、 calc 関数、add, subtract, multiply, divide 関数を使用して 加算結果を標準出力に出力します。

Definition in file shared-and-static-calc.c.

Function Documentation

◆ main()

int main ( int argc,
char * argv[] )

プログラムのエントリーポイント。

Parameters
[in]argcコマンドライン引数の数。
[in]argvコマンドライン引数の配列。
Returns
成功時は 0、失敗時は 0 以外の値を返します。

使用例:

./add 10 + 20
// 出力: 30
int add(const int a, const int b, int *result)
2 つの整数を加算します。
Definition add.c:20
Attention
引数は正確に 3 つ必要です。

Definition at line 42 of file shared-and-static-calc.c.

References add(), CALC_KIND_ADD, CALC_KIND_DIVIDE, CALC_KIND_MULTIPLY, CALC_KIND_SUBTRACT, calcHandler(), divide(), multiply(), and subtract().

Here is the call graph for this function: