LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   how to get hard copy( print out ) of output or report in c++ in codeblocks. (https://www.linuxquestions.org/questions/programming-9/how-to-get-hard-copy-print-out-of-output-or-report-in-c-in-codeblocks-4175673022/)

rahulvishwakarma 04-11-2020 10:48 AM

how to get hard copy( print out ) of output or report in c++ in codeblocks.
 
hi to all, I've centos7.5 and codeblocks in VM. I am trying to get report of ( or file in C++ ) in hard copy by print like option as in gui. but have no idea. please any suggetion.

business_kid 04-11-2020 12:31 PM

No programmer, but if you can view them on a screen, there are numerous copy/paste options. It not, email then to yourself or put the code on google drive?

BW-userx 04-11-2020 12:38 PM

yes i think you just got to high light the messages, and right click or click around in that message window, and find copy all then paste it into a separate text file, then you can print it out. yes?

TB0ne 04-11-2020 02:00 PM

Quote:

Originally Posted by rahulvishwakarma (Post 6110415)
hi to all, I've centos7.5 and codeblocks in VM. I am trying to get report of ( or file in C++ ) in hard copy by print like option as in gui. but have no idea. please any suggetion.

You've been using codeblocks for SIX YEARS now...and you haven't read the manual? Their own software guides and wiki tell you how to print, and offer numerous samples on how to configure page size, etc.

Past that, as others have said, you can copy/paste into whatever you want, and print from there.

rahulvishwakarma 04-12-2020 04:18 AM

thanks for reply. actually i want to embed code in my c++ application so that my software have print functionality.

TB0ne 04-12-2020 09:50 AM

Quote:

Originally Posted by rahulvishwakarma (Post 6110617)
thanks for reply. actually i want to embed code in my c++ application so that my software have print functionality.

Ok, so you *WRITE YOUR CODE* to have a print function. So post what you've written, and tell us where you're stuck.

SoftSprocket 04-12-2020 10:04 AM

Quote:

Originally Posted by rahulvishwakarma (Post 6110415)
hi to all, I've centos7.5 and codeblocks in VM. I am trying to get report of ( or file in C++ ) in hard copy by print like option as in gui. but have no idea. please any suggetion.

You'll get better answers by asking a better question. From your subsequent post it would seem your question is "how to write to a printer in C or C++"?

If that's correct:
You can write directly to the device by opening it with popen (stdio.h) and then using the standard stream functions but this isn't very portable.

A better approach might be to use the CUPS library. Here's a good place to start:
https://www.cups.org/doc/cupspm.html

astrogeek 04-12-2020 09:36 PM

Quote:

Originally Posted by rahulvishwakarma (Post 6110617)
thanks for reply. actually i want to embed code in my c++ application so that my software have print functionality.

That is quite a different question than the thread title suggests. You might want to review the Site FAQ pages for help in forming your questions, and in particular the link you will find there to the article How To Ask Questions the Smart Way, which has many good tips!

Good luck!


All times are GMT -5. The time now is 11:30 PM.