This repository was archived by the owner on Feb 11, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +23
-20
lines changed Expand file tree Collapse file tree 2 files changed +23
-20
lines changed Original file line number Diff line number Diff line change 1
1
# CLI template for C/C++
2
2
3
- This is template app for CLI test.
4
- You can make console application by editing files under src directory.
5
- As default, app.cpp has ` main ` function. You can start to develop from here.
3
+ Implement CLI application by editing [ src/app.cpp] ( src/app.cpp ) .
4
+ You may add new files to keep your code clean, if it is allowed in your challenge.
6
5
7
6
## How to get input parameters
8
- Same as ususal C++ application, ` main ` function takes following parameters.
9
- app.py has a function ` main `
10
-
11
- - ` int argc ` : The number of parameters. (including program name.)
12
- - ` char *argv[] ` : The array of char pointer.
7
+ You can get arguments with ordinary C++ way, using ` int argc ` and ` char * argv[] ` .
8
+
9
+ ``` cpp
10
+ int main (int argc, char * argv[ ] )
11
+ {
12
+ // code to run
13
+ return 0;
14
+ }
15
+ ```
13
16
14
17
## How to output result
15
18
You can use `cout`, `printf`, etc.
Original file line number Diff line number Diff line change 1
- # CLIアプリケーション作成用テンプレート (C/C++)
1
+ # コマンドラインアプリケーション(CLI アプリ)作成用テンプレート (C/C++)
2
2
3
- C/C++でCLIアプリケーションを作成するためのテンプレートです。
4
-
5
- srcフォルダ以下の* .cppファイルを編集することでCLIアプリケーションを作成することができます。
6
- デフォルトでは[ app.cpp] ( src/app.cpp ) ファイルにmain関数が定義されているのでそこから開発を開始してください。
3
+ [ app.cpp] ( src/app.cpp ) を編集して、CLIアプリを実装してください。
4
+ チャレンジ内でファイルの作成が許可されていれば、可読性等のためにファイルを分割する事も可能です。
7
5
8
6
## コマンドライン引数の取得方法
9
- 通常のC++アプリケーションと同じです。
10
- main関数の引数として
11
-
12
- - ` int argc ` : 引数の総数(プログラム名を含む)
13
- - ` char *argv[] ` : 引数の文字列を指すポインタの配列
14
-
15
- が渡されます。
7
+ 通常のC++アプリケーションと同じように、` int argc ` と ` char * argv[] ` を使用してください。
8
+
9
+ ``` cpp
10
+ int main (int argc, char * argv[ ] )
11
+ {
12
+ // code to run
13
+ return 0;
14
+ }
15
+ ```
16
16
17
17
## コマンド実行結果の標準出力への出力
18
18
cout、printf等標準出力に出力する任意のメソッドが使用可能です。
You can’t perform that action at this time.
0 commit comments