473,434 Members | 1,430 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,434 software developers and data experts.

how to print in linux with c++ programming?

1
hello
I am new in c++ and linux.but Iwant to print in linux with c++ programming.please help me?
Jul 31 '07 #1
2 2235
archonmagnus
113 100+
hello
I am new in c++ and linux.but Iwant to print in linux with c++ programming.please help me?
You could try the following:

Expand|Select|Wrap|Line Numbers
  1. // With your preprocessor directives
  2. #include <string>
  3.  
  4. string filename;
  5.  
  6. cout<<"Enter filename to print: ";
  7. getline(cin, filename);
  8.  
  9. string printArgs = "lp " + filename;
  10.  
  11. // passes the command, "lp <filename" to the system
  12. //    for Linux, Unix, BSD, etc. see "man lp"
  13. system(printArgs);
  14.  
You can view the contents of man lp for more arguments to pass to lp (such as printer destinations, number of copies, etc.)
Jul 31 '07 #2
weaknessforcats
9,208 Expert Mod 8TB
You need to ask a more specific question. What you posted is found within the first 20 pages of any C++ textbook.

Please read the posting guidelines.
Jul 31 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: inquirydog | last post by:
Hello- I, the inquirydog, would like to solicit suggestions for a new web page I am making: I am creating a simple website that will translate concepts between windows os's, Linux, and the...
4
by: Rusty Shackleford | last post by:
I have a Summer in front of me without any school, and I'd like to add a new format for python print strings that will show any number in a binary representation. For example: >>> '%b' % 3 11...
2
by: beliavsky | last post by:
Linux Journal annually polls its readers on questions such as their favorite programming language. In the 2005 poll, Python is 2nd, its highest ranking ever. Below are the results by year. I wish...
1
by: Sandeep | last post by:
Hi, I want to read & print a UTF-8 encoded characters stored in a file. I want to write a C program on Linux platform to achieve this. I am new to UTF-8. I will appreciate any sample...
10
by: stylecomputers | last post by:
Hey guys, I am absolutely new to Linux programming, with no w######s programming experience except a small amount of C++ console apps. Reasonably new to Linux, BSD etc, got good sound networking...
17
by: Nirjhar Oberoi | last post by:
Hi, I am new to Linux and wanted to know how to use GCC to Compile the Code written in C? I dont want to use EMacs or VI for my editor. Can you suggest a good IDE for linux for C Programming.. ...
12
by: Magesh | last post by:
Can anyone suggest me a good book to learn C/C++ programming under Linux platform?
2
by: CC | last post by:
Hi: I've conjured up the idea of building a hex line editor as a first real Python programming exercise. To begin figuring out how to display a line of data as two-digit hex bytes, I created...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.