Thread: user input pre-enter string?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Nov 2009
    Posts
    27

    user input pre-enter string?

    Using getline(cin, string) is it possible to pre-enter the string so the user can edit it, a bit like when you press up in the console?

    Code:
    string astring;
    cout<<"Please change this text: ";
    astring = "This is to be in the prompt the users edits.";
    getline(cin, astring); //Prompts user input
    cout<<astring<<endl; //Outputs the edited string
    So the console would give this, the part after the colon being editable:
    Code:
    Please change this text: This is to be in the prompt the users edits.
    Last edited by mikeyp; 11-25-2009 at 12:19 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. can someone help me with these errors please code included
    By geekrockergal in forum C Programming
    Replies: 7
    Last Post: 02-10-2009, 02:20 PM
  2. RicBot
    By John_ in forum C++ Programming
    Replies: 8
    Last Post: 06-13-2006, 06:52 PM
  3. Replies: 5
    Last Post: 07-05-2005, 12:37 PM
  4. lvp string...
    By Magma in forum C++ Programming
    Replies: 4
    Last Post: 02-27-2003, 12:03 AM