Implement CLI application by editing main.cpp.
You may add new files to keep your code clean, if it is allowed in your challenge.
You can get arguments with ordinary C++ way, using int argc
and char * argv[]
.
int main(int argc, char * argv[])
{
// code to run
return 0;
}
You can use cout
, printf
, etc.
cout << argv[0] << endl
To compile, we are using clang c++ command.
If you want to change compile option or etc, please edit codecheck.yml build
section.
(If you change output filename, you have to change env/APP_COMMAND section too.)
You can build pure C application by switching compiler command from c++
to clang
.
To use codecheck command in your local environment, you need to modify codecheck.yml in order to run test properly.Don't forget to restore the file at the time of submit!
# Before
build:
- c++ -o theapp.o src/*.cpp
env:
APP_COMMAND: ./theapp.o
test: mocha
# After
build:
- c++ -o theapp.o "src/*.cpp"
env:
APP_COMMAND: ./theapp.o
test: mocha