Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
Command Line Arguments
(1/1)
Kuriyaki:
Is it possible to use command line arguments? In other words...
int main( int argc, char* argv[] )
{
... // Program that uses the input from user in terminal window? argv[1], 2...etc
return 0;
}
I'm fairly new with CodeBlocks. Sorry for the question. Looks great so far!
Ceniza:
Yeah, sure. Just add them thru Project -> Set program's arguments... Select the target you want, add its arguments and click OK. Now, when you click on Run, Code::Blocks will pass those arguments to your executable.
Before you ask: it only works for projects.
Kuriyaki:
Awesome! Thank you very much. Was afraid people would consider it a coding/development question.
Kuriyaki:
Whenever I want to read/write to a file in CodeBlocks
Where should I place those files? Under the main project folder? Is it able to write to files? Been trying to and it doesn't allow me.
Navigation
[0] Message Index
Go to full version