How do I properly pass command line arguments to a C program in CLion?
18,618
Solution 1
If you click on Run
-Edit Configurations
you can create an "Application" configuration that allows you to provide the Program arguments
- either in a single line, or in a separate window one argument per line.
Solution 2
I landed on this SO page as I was using CLion with Rust.
For Rust I was able to add the command line arguments to the end of the Run\Edit Configurations\Command
. Notice the required --
.
I got this tip from Jetbrains.
For C, it was Run\Edit Configurations\Program Arguments
, as @Zulan said.
![Kevin Cianfarini](https://lh4.googleusercontent.com/-FYR25a-s-K4/AAAAAAAAAAI/AAAAAAAAA28/DXJZyEvQYoA/photo.jpg?sz=256)
Author by
Kevin Cianfarini
Updated on July 16, 2022Comments
-
Kevin Cianfarini almost 2 years
I need someone to outline how to pass command line arguments to CLion. What I've found so far hasn't worked for me. Specifically I need to know how to pass multiple arguments to the program from the command line.
-
NathanOliver over 8 yearsHave you seen this?
-
-
Stefan Teunissen almost 3 yearsThank you, took me a while to find this post.