Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Linux を使用して、.txt ファイルを argc として受け取る C++ プログラムを実行する場合。すなわち
int main(int argc, char *argv[])
単純にコンパイルしてから入力できます./a.out file.txt
./a.out file.txt
Windows を使用している場合、コンパイル後、file.txt を argc として含めて実行するにはどうすればよいですか?
これと同じ方法で、実行可能ファイルの名前のみが変更されますprogram_name.exe file.txt。
program_name.exe file.txt