How to print in C/C++

Discussion in 'C Programming' started by Sanchit, May 30, 2007.

  1. Sanchit

    Sanchit Guest

    I want to print a specific portion of output screen using a printer.
    How can i do this using C/C++ commands???????

    Thanks in advance
    Sanchit, May 30, 2007
    #1
    1. Advertising

  2. * Sanchit:
    > I want to print a specific portion of output screen using a printer.
    > How can i do this using C/C++ commands???????


    DON'T CROSS-POST TO C AND C++ GROUPS.

    Also, please consult the relevant FAQ before posting. See e.g. <url:
    http://www.parashift.com/c++-faq-lite/input-output.html#faq-15.20>,
    which treats a very similar question.

    Also see <url:
    http://www.parashift.com/c++-faq-lite/how-to-post.html#faq-5.9>.

    --
    A: Because it messes up the order in which people normally read text.
    Q: Why is it such a bad thing?
    A: Top-posting.
    Q: What is the most annoying thing on usenet and in e-mail?
    Alf P. Steinbach, May 30, 2007
    #2
    1. Advertising

  3. Sanchit

    Sanchit Guest

    On May 30, 3:17 pm, "Alf P. Steinbach" <> wrote:
    > * Sanchit:
    >
    > > I want to print a specific portion of output screen using a printer.
    > > How can i do this using C/C++ commands???????

    >
    > DON'T CROSS-POST TO C AND C++ GROUPS.
    >
    > Also, please consult the relevant FAQ before posting. See e.g. <url:http://www.parashift.com/c++-faq-lite/input-output.html#faq-15.20>,
    > which treats a very similar question.
    >
    > Also see <url:http://www.parashift.com/c++-faq-lite/how-to-post.html#faq-5.9>.
    >
    > --
    > A: Because it messes up the order in which people normally read text.
    > Q: Why is it such a bad thing?
    > A: Top-posting.
    > Q: What is the most annoying thing on usenet and in e-mail?



    I dont want to clear screen... please read question clearly........
    Sanchit, May 30, 2007
    #3
  4. * Sanchit:
    > On May 30, 3:17 pm, "Alf P. Steinbach" <> wrote:
    >> * Sanchit:
    >>
    >>> I want to print a specific portion of output screen using a printer.
    >>> How can i do this using C/C++ commands???????

    >> DON'T CROSS-POST TO C AND C++ GROUPS.
    >>
    >> Also, please consult the relevant FAQ before posting. See e.g. <url:http://www.parashift.com/c++-faq-lite/input-output.html#faq-15.20>,
    >> which treats a very similar question.
    >>
    >> Also see <url:http://www.parashift.com/c++-faq-lite/how-to-post.html#faq-5.9>.

    >
    > I dont want to clear screen... please read question clearly........


    Read answer clearly. Apply brain. Don't quote signatures.

    --
    A: Because it messes up the order in which people normally read text.
    Q: Why is it such a bad thing?
    A: Top-posting.
    Q: What is the most annoying thing on usenet and in e-mail?
    Alf P. Steinbach, May 30, 2007
    #4
  5. Sanchit

    blufox Guest

    On May 30, 3:25 pm, Sanchit <> wrote:
    > On May 30, 3:17 pm, "Alf P. Steinbach" <> wrote:
    >
    >
    >
    > > * Sanchit:

    >
    > > > I want to print a specific portion of output screen using a printer.
    > > > How can i do this using C/C++ commands???????

    >
    > > DON'T CROSS-POST TO C AND C++ GROUPS.

    >
    > > Also, please consult the relevant FAQ before posting. See e.g. <url:http://www.parashift.com/c++-faq-lite/input-output.html#faq-15.20>,
    > > which treats a very similar question.

    >
    > > Also see <url:http://www.parashift.com/c++-faq-lite/how-to-post.html#faq-5.9>.

    >
    > > --
    > > A: Because it messes up the order in which people normally read text.
    > > Q: Why is it such a bad thing?
    > > A: Top-posting.
    > > Q: What is the most annoying thing on usenet and in e-mail?

    >
    > I dont want to clear screen... please read question clearly........


    If you read it a little more clearly you 'll find it is not a C or C++
    feature.
    In other words C or C++ do not even know that there is a screen. So
    this is irrelevant from C's point of view.

    Check you OS docs for help.

    PS: Learn to follow the advice.

    Thanks
    blufox, May 30, 2007
    #5
  6. Sanchit

    jacob navia Guest

    Sanchit wrote:
    > I want to print a specific portion of output screen using a printer.
    > How can i do this using C/C++ commands???????
    >
    > Thanks in advance
    >


    Under windows you can use the text mode APIs to read from the
    screen the characters displayed.

    Under linux, I think I remember that the curses library
    provided a similar capability.
    jacob navia, May 30, 2007
    #6
  7. Sanchit

    Sanchit Guest

    I undersatnd that this is not C/c++. But then where i can find a
    solution
    Sanchit, May 30, 2007
    #7
  8. Sanchit

    osmium Guest

    "Sanchit" writes:

    >I undersatnd that this is not C/c++. But then where i can find a
    > solution


    Do you think there is a single human being on this planet, other than
    yourself, that can make any sense out of the post you made?
    osmium, May 30, 2007
    #8
  9. Sanchit

    kingfox Guest

    On 5ÔÂ30ÈÕ, ÏÂÎç9ʱ23·Ö, Sanchit <> wrote:
    > I undersatnd that this is not C/c++. But then where i can find a
    > solution


    Maybe you can get answer at comp. os. ms-windows. programmer. win32.
    kingfox, May 30, 2007
    #9
  10. jacob navia wrote:
    >
    > Sanchit wrote:
    > > I want to print a specific portion of output screen using a printer.
    > > How can i do this using C/C++ commands???????

    >
    > Under windows you can use the text mode APIs to read from the
    > screen the characters displayed.


    Assuming that you are talking about a console window in the
    first place.

    > Under linux, I think I remember that the curses library
    > provided a similar capability.


    But only if all output was done by the current process via the
    curses library.

    ie: no printf()s, nor anything output via system().

    --
    +-------------------------+--------------------+-----------------------+
    | Kenneth J. Brody | www.hvcomputer.com | #include |
    | kenbrody/at\spamcop.net | www.fptech.com | <std_disclaimer.h> |
    +-------------------------+--------------------+-----------------------+
    Don't e-mail me at: <mailto:>
    Kenneth Brody, May 30, 2007
    #10
  11. On 30 May 2007 03:07:54 -0700, in comp.lang.c , Sanchit
    <> wrote:

    >I want to print a specific portion of output screen using a printer.
    >How can i do this using C/C++ commands???????


    Standard C (the topic of CLC) offers no facility to do this. You will
    need to ask specialists in your operating system and/or compiler
    platform, in a different group.
    --
    Mark McIntyre

    "Debugging is twice as hard as writing the code in the first place.
    Therefore, if you write the code as cleverly as possible, you are,
    by definition, not smart enough to debug it."
    --Brian Kernighan
    Mark McIntyre, May 30, 2007
    #11
  12. On 30 May 2007 06:23:23 -0700, in comp.lang.c , Sanchit
    <> wrote:

    >I undersatnd that this is not C/c++. But then where i can find a
    >solution


    By asking in the RIGHT PLACE. You need to ask the experts in your
    platform, not the experts in C.

    --
    Mark McIntyre

    "Debugging is twice as hard as writing the code in the first place.
    Therefore, if you write the code as cleverly as possible, you are,
    by definition, not smart enough to debug it."
    --Brian Kernighan
    Mark McIntyre, May 30, 2007
    #12
  13. Sanchit

    Das Guest

    On May 30, 3:07 pm, Sanchit <> wrote:
    > I want to print a specific portion of output screen using a printer.
    > How can i do this using C/C++ commands???????
    >
    > Thanks in advance


    This is fully dependant on your setup. Nothing to do with C/C++.
    If you use DOS and TURBO-C/C++ you can do it by using DOS.H.
    If you are on Linux then it is difficult to do such a thing readily.
    Under linux you have to port your code to CURSES/NCURSES, and you have
    controll over the output.

    Else if you are a very low level programmer then you can go to the
    display buffer in your videocard
    and manipulate. ;)
    Das, May 31, 2007
    #13
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bad_Kid
    Replies:
    3
    Views:
    3,933
    Shawn H. Mesiatowsky
    Apr 7, 2005
  2. Bryan Shaw

    Lock Print Screen and File Print

    Bryan Shaw, Apr 19, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    3,934
    Kevin Spencer
    Apr 20, 2005
  3. EDom
    Replies:
    0
    Views:
    434
  4. keto
    Replies:
    0
    Views:
    901
  5. David Cournapeau

    print a vs print '%s' % a vs print '%f' a

    David Cournapeau, Dec 30, 2008, in forum: Python
    Replies:
    0
    Views:
    336
    David Cournapeau
    Dec 30, 2008
Loading...

Share This Page