Code::Blocks Forums
Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: Kuriyaki on March 18, 2008, 06:10:59 am
-
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!
-
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.
-
Awesome! Thank you very much. Was afraid people would consider it a coding/development question.
-
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.