Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Write to standard error with C++ on FreeBSD

Status
Not open for further replies.

FellowCraft

Programmer
Oct 28, 2000
2
US
I would like to write a program using gnu C++ (g++) on a FreeBSD machine. My problem is any output (standard output)will be taken as a password to start apache with mod_ssl. I want to be able to prompt the user for the password. I know Unix has standard output and standard error. Both display to the terminal (by default). If I can display to standard error I don't think apache will take that as the password.

In short "How do I write to standard error with c++"

If this does work I will also want to know how to hide the user input so it will not be displayed on the screen as it is typed.
 
Sorry, I just noticed I was in Borland and not Unix. Oops. Well if you know the answer Id still be very happy to hear it. (I do use Borland at home if that counts for anything)
 
One way is cerr << &quot;This goes to standard error stream&quot; << endl. BTW, the only difference between cout & cerr is cerr is not buffered.
[sig]<p>James P. Cottingham<br><a href=mailto: > </a><br><a href= Veneer Co., Inc.</a><br>All opinions are mine alone and do not necessarily reflect those of my employer.[/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top