Ask coding questions

← Back to all posts
Command line arguments; running repls elsewhere?
BAGold

(1) how does one pass command line args to a C program in the IDE? As in "main xxxx 7"

(2) once I get a repl working, is it possible to download an executable to run the program elsewhere (e.g., on this PC)?

Thanks very much.
BG

Voters
BAGold
Comments
hotnewtop
bendev9

For the arguments, you can create a .replit file. This overrides the run button, so it might not work straight away. I would suggest making a run.sh to put all of the run commands in, then in .replit put ./run.sh. With this you can compile then run with arguments. This is a sort of general guide, but I hope it helps :)

BAGold

@bendev9
Thanks very much. I'll tinker some more (I realized I can run it "manually", with args, from the shell.

And my second question was silly; I found a C compiler for local use.

Thanks again.