LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-16-2013, 07:01 PM   #1
Bob01
LQ Newbie
 
Registered: Jun 2013
Location: Chicago
Posts: 4

Rep: Reputation: Disabled
parsing command line arguments using an IDE (how to)


Hi all,

To say I'm a newbie would be an understatement, so I apologize for the dumb question(s) and comments.

Anyhoo,

I'm a soon-to-be-second-year computer science student. We study a lot of C. When we began, we never used anything from the command line -- my "main" up to this point has always been:

Code:
int main(){}
Yes, I know, pretty lame...

Also, until a couple of weeks ago, I was a Windows user (I switched to Ubuntu two weeks ago), so I did all of my assignments using the Visual Studio C++ Express IDE. I really liked it -- I know that it's kind of lame to enjoy the fancy debugger, but jeez, Visual Studio can do stuff like show you a dynamic representation of whatever is in your array (in real time, as you're stepping through it), or a representation of what's in your struct in a linked list. Easy-to-manipulate break points. Watches that are all neat and tidy in their own window, changing in real time. Great stuff!

What's changed about my coding environment is that next semester, we have to start parsing and implementing arguments from the command line, so now my main is (as it should be):

Code:
int main(int argc, char *argv[]){}
Parsing command line arguments should probably have been, like, lesson #2, but it wasn't...

Here is my problem: in the IDEs that I like, you always run your programs as console applications. You compile the program by hitting a button that says "compile", and you run by hitting a button that says "run". As far as I can tell, there isn't anything -- in Visual Studio C++ or Code Blocks, at least -- that allows the programmer to compile with command line arguments (probably because you're not on the command line).

I know that the answer is something like "Learn vim and gdb and get over it", but geez, it seems that there would be some IDE that could be used to parse command line arguments.

So: is there such a thing?

I have been learning vim and gdb -- out of necessity -- but I would switch back to an IDE with the fancy debugging stuff if I could find one that allowed me to parse command line arguments as well.

And look, I know that gdb can do all of those aforementioned fancy debugging stuff, but it's a hassle -- having to line up the window with the code next to the gdb debugger, and -- this is really the main part -- I really like having color-coordinated code. Vim has a fine color coordination scheme, but gdb does not. I tried gdb -tui, but it doesn't seem to play well with user input (and, of course, it isn't color coordinated either).

Any thoughts/suggestions/constructive/or/destructive criticisms?
 
Old 07-16-2013, 07:19 PM   #2
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
In CodeBlocks you should find an option to set command line arguments in the Project menu.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Parsing command line arguments in PHP resetreset Programming 1 02-01-2010 03:39 AM
need some help regarding command line arguments kristam269 Linux - General 1 01-23-2007 09:40 AM
Command line arguments?? almagerenia Linux - Newbie 1 09-08-2006 04:05 AM
command line arguments containing ( Lotharster Linux - Newbie 3 01-05-2006 08:43 AM
Help with command line arguments ? synapse Linux - Newbie 2 02-23-2004 02:25 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:37 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration