Thread: Multiple inputs on one line.

  1. #1
    Registered User
    Join Date
    Apr 2008
    Posts
    3

    Multiple inputs on one line.

    Hi, I have a problem and I'm wondering if anyone can help.

    Basically I need to input two values on one line so that they are aligned with their headings. Sort of in table form.

    I realise that you can enter two values on the same line using the scanf() function but you have to press space instead of return using this and there's no way of aligning the values I have typed to the heading that I have printed.

    If anyone could help me with this I would be very grateful.

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    If you really want to format your input in such a way, then you will need to use "raw input". What OS is this for?

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  3. #3
    Registered User
    Join Date
    Apr 2008
    Posts
    3
    xp. I'm using visual c++.

    I don't want to over complicate things though. If there's not a simple way of doing it then it doesn't really matter.

  4. #4
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    No, there's no simple way to do that.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  5. #5
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    There is with pdcurses

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. towers of hanoi problem
    By aik_21 in forum C Programming
    Replies: 1
    Last Post: 10-02-2004, 01:34 PM
  2. Multiple inputs with cin
    By DJPG5 in forum C++ Programming
    Replies: 2
    Last Post: 02-16-2003, 04:10 PM
  3. Greenhand want help!
    By leereg in forum C Programming
    Replies: 6
    Last Post: 01-29-2002, 06:04 AM
  4. Getting multiple inputs using cin
    By edk in forum C++ Programming
    Replies: 2
    Last Post: 09-13-2001, 02:34 PM