c++ command line arguments in ubuntu terminal -
this basic question beginning use command line arguments in programs. compile program in terminal g++ example.cpp
type ./a.out
, cout
/cin
, forth.
my question is, after have compiled program, type in terminal let know input arguments?
create output file of same program. entering in terminal:
g++ example.cpp -o example
when compiled, run program as:
./example arg1 arg2
even above method @petr budnik works.
Comments
Post a Comment