Console Display to Char Array

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bluesteel
    New Member
    • Mar 2007
    • 84

    Console Display to Char Array

    I need to save what the console is showing into an array and i know there's a function for that, i do really need this function for a program i am currently working on and i would be grateful if you gave me some instructions on how to do it.

    *************** *****
    ****Console**** **
    *************** ****

    Hello World
    And GoodBye

    *************** *****
    ***Array******* ****
    *************** *****

    this is what the array should contain:
    "Hello World\nAnd GoodBye"
  • RedSon
    Recognized Expert Expert
    • Jan 2007
    • 4980

    #2
    Can you not just read each line of text and put it in an array element?

    Comment

    • sicarie
      Recognized Expert Specialist
      • Nov 2006
      • 4677

      #3
      And please read the Posting Guidelines, specifically those relating to good thread titles.

      Comment

      • JosAH
        Recognized Expert MVP
        • Mar 2007
        • 11453

        #4
        Originally posted by bluesteel
        I need to save what the console is showing into an array and i know there's a function for that, i do really need this function for a program i am currently working on and i would be grateful if you gave me some instructions on how to do it.

        *************** *****
        ****Console**** **
        *************** ****

        Hello World
        And GoodBye

        *************** *****
        ***Array******* ****
        *************** *****

        this is what the array should contain:
        "Hello World\nAnd GoodBye"
        I'd build a wrapper for two classes, one of them should be cout, the other
        one can be any ostream or other class. Whatever is fed to the wrapper is
        'Tee-piped' into the original cout, the other side of the Tee-pipe goes straight
        into an array (read:vector or string output stream).

        kind regards,

        Jos

        Comment

        Working...