News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

How to add custom command line arguments?

Started by fuzzymonkey, November 17, 2010, 04:55:04 PM

Previous topic - Next topic

fuzzymonkey

I have a project that reads in a file supplied by command line arguments. for testing purposes, it is the first argument (argv[1]). I tried to add the name of the file by going Projects->set programs' arguments-> and just typing in the name of the file under Programs arguments (for both the release version and the debug). However, my program always terminates after checking for the existence of the file passed from command line, meaning it was never passed in. If I execute my program from command line and manually add the file name, it works fine, it just does not work when I do it in codeblocks.

Any ideas?

oBFusCATed

Have you tried "Project -> Set program's arguments" ?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

fuzzymonkey

Sorry to be an ass, but..... Did you even read my post? Specifically the second sentence when I said exactly that....

oBFusCATed

OK, Sorry, I've not read it fully...

This feature works, so you have to debug it yourself, using the debugger...
Put a breakpoint in the beginning of main and step from there...

Probably the working directory is not the one you're expecting.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]