Urgent: output editable text to dos

This is a discussion on Urgent: output editable text to dos within the C Programming forums, part of the General Programming Boards category; Anyone know of a way to output editable text to dos? since printf() outputs text that cannot be edited, is ...

  1. #1
    Registered User
    Join Date
    Sep 2002
    Posts
    2

    Question Urgent: output editable text to dos

    Anyone know of a way to output editable text to dos?
    since printf() outputs text that cannot be edited, is there a way to do that?

  2. #2
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    It is possible if you make your own text buffer, and use printf() and gotoxy().
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  3. #3
    Registered User
    Join Date
    Sep 2002
    Posts
    2

    Stringbuffer?

    do you mind showing me an example magos?

  4. #4
    moi
    moi is offline
    Registered User moi's Avatar
    Join Date
    Jul 2002
    Posts
    946

    Re: Urgent: output editable text to dos

    Originally posted by samohx
    Anyone know of a way to output editable text to dos?
    since printf() outputs text that cannot be edited, is there a way to do that?
    well what you mean, mr. urgent? once the text has been put on the screen, it is no longer editable in any way that could be considered at all portable, except for maybe using \b to erase it and the write over it, but i'm not sure how well even that works.

    do you want to printf() then examine and possibly change the contents, and then put it to the screen? then use sprintf(). but i have a feeling if this is the case, you're trying to do something that you could do with printf if you knew all the format modifiers.

    by editable do you mean in a text editor or something? then you dont want it on the screen, you want it outputted to a file. use fprintf().
    hello, internet!

  5. #5
    Carnivore ('-'v) Hunter2's Avatar
    Join Date
    May 2002
    Posts
    2,879
    I think he means dos-prompt style.

    You could printf() the string, and then go getch() and append the character to the string, then rewrite the string. If it is a backspace character, output backspace, space, backspace to the screen and it should have deleted one character. And so on.

    **EDIT**
    If you're trying to input data, the text is editable. (i.e. scanf()) Of course, that goes without saying, but I decided to say it anyways
    Just Google It. √

    (\ /)
    ( . .)
    c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. A bunch of Linker Errors...
    By Junior89 in forum Windows Programming
    Replies: 4
    Last Post: 01-06-2006, 01:59 PM
  2. text box & buttons on window .. pls help urgent ???
    By intruder in forum Windows Programming
    Replies: 5
    Last Post: 12-15-2002, 09:28 PM
  3. Ok, Structs, I need help I am not familiar with them
    By incognito in forum C++ Programming
    Replies: 7
    Last Post: 06-29-2002, 09:45 PM
  4. C++ text file output...specifics
    By paranoidandroid in forum C++ Programming
    Replies: 3
    Last Post: 12-31-2001, 09:57 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21