Computing.Net > Forums > Programming > c++ command line editing

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.

c++ command line editing

Reply to Message Icon

Name: jlarson
Date: September 3, 2003 at 20:40:58 Pacific
OS: gnu/linux
CPU/Ram: 850mhz 256mb
Comment:

I've just recently started learning c++. I'm currently working on a simple calculator which allows the user to input into a char array. I was wondering if anyone could point me in the right direction to figure out how to add command line editing functionality. What library and/or what function could I use? Thanks in advance.



Sponsored Link
Ads by Google

Response Number 1
Name: Infinite Recursion
Date: September 3, 2003 at 21:40:03 Pacific
Reply:

You can process command-line arguments using C++ as follows:

#include &ltiostream.h>
int main (int argc, char **argv)
{
   cout &lt&lt "Received " << argc << " arguments...\n";

for (int i=0; i < argc; i++)
{
   cout << "argument " << i << ": " << argv[i] << endl;
}
return 0;
}

Infinite Recursion


0

Response Number 2
Name: Infinite Recursion
Date: September 3, 2003 at 21:42:56 Pacific
Reply:

Of course my reference to the '& l t' is a less than character... not sure what happened on that. At any rate, that code will give you access to command-line arguments.

Infinite Recursion


0

Response Number 3
Name: jlarson
Date: September 4, 2003 at 07:00:38 Pacific
Reply:

I think you misunderstand. Perhaps I did not explain it properly. I'm not wanting to process command line arguments. I want to allow a user to edit their input before pressing enter. They should be able to use the arrow keys to go back and change parts of their inputs instead of using backspace and deleting part of the input. Just like command line editing in bash.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


loading text into a textb... wireless network sniffer



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: c++ command line editing

C++ Command-Line Arguments www.computing.net/answers/programming/c-commandline-arguments/4864.html

Terminal font in command line? (C#) www.computing.net/answers/programming/terminal-font-in-command-line-c/12827.html

borland c++ 5.5 command line tools www.computing.net/answers/programming/borland-c-55-command-line-tools/3223.html