Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 926975
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T19:46:35+00:00 2026-05-15T19:46:35+00:00

What is the difference between them and how are they used? Can anyone point

  • 0

What is the difference between them and how are they used?
Can anyone point me to examples?

Specifically, how do you “write” to the stream in both cases and how do you recover and output (i.e. to the screen) the text that had been written to it?

Also, the “screen” output is itself a stream right? Maybe I don’t understand streams well enough. This can also be saved to a file of course, I know. Would all of these use fprintf / fscanf, etc?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T19:46:35+00:00Added an answer on May 15, 2026 at 7:46 pm

    cerr is the C++ stream and stderr is the C file handle, both representing the standard error output.

    You write to them the same way you write to other streams and file handles:

    cerr << "Urk!\n";
    fprintf (stderr, "Urk!\n");
    

    I’m not sure what you mean by “recover” in this context, the output goes to standard error and that’s it. The program’s not meant to care about it after that. If you mean how to save it for later, from outside the program, see the next paragraph.

    By default, they’ll go to your terminal but the output can be redirected elsewhere with something like:

    run_my_prog 2>error.out
    

    And, yes, the “screen” output is a stream (or file handle) but that’s generally only because stdout/cout and stderr/cerr are connected to your “screen” by default. Redirection will affect this as in the following case where nothing will be written to your screen:

    run_my_prog >/dev/null 2>&1
    

    (tricky things like writing directly to /dev/tty notwithstanding). That snippet will redirect both standard output and standard error to go to the bit bucket.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What is the difference between them? If I use them both on my local
What is the difference between sizeof(3.0) and sizeof(3.0f) I was expecting both of them
What's the difference between window.location and document.location? Should both of them reference the same
Can anyone tell me the difference between a simple database and a data warehouse
Can anyone break it down in plain English the performance difference between using temp
I'm using them alternately. Is there a difference between them?
I have 2 classes that have exact two functions. The difference between them is
What are Vertex and Pixel shaders? What is the difference between them? Which one
This is a simple question from algorithms theory. The difference between them is that
What is difference between HTTPPOST HTTPDELETE HTTPPUT HTTPGET Normally used post and get method

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.