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 6357543
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:11:07+00:00 2026-05-24T23:11:07+00:00

I had been reading a few articles on some sites about Formatted and Unformatted

  • 0

I had been reading a few articles on some sites about Formatted and Unformatted I/O, however i have my mind more messed up now.

I know this is a very basic question, but i would request anyone can give a link [ to some site or previously answered question on Stackoverflow ] which explains, the idea of streams in C and C++.

Also, i would like to know about Formatted and Unformatted I/O.

  • 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-24T23:11:08+00:00Added an answer on May 24, 2026 at 11:11 pm

    Formatted IO means that your output is determined by a “format string”, that means you provide a string with certain placeholders, and you additionally give arguments that should be used to fill these placeholders:

    const char *daughter_name = "Lisa";
    int daughter_age = 5;
    printf("My daughter %s is %d years old\n", daughter_name, daughter_age);
    

    The placeholders in the example are %s, indicating that this shall be substituted using a string, and %d, indicating that this is to be replaced by a signed integer number. There are a lot more options that give you control over how the final string will present itself. It’s a convenience for you as the programmer, because it relieves you from the burden of converting the different data types into a string and it additionally relieves you from string appending operations via strcat or anything similar.

    Unformatted IO on the other hand means you simply write character or byte sequences to a stream, not using any format string while you are doing so.

    Which brings us to your question about streams. The general concept behind “streaming” is that you don’t have to load a file or whatever input as a whole all the time. For small data this does work though, but imagine you need to process terabytes of data – no way this will fit into a single byte array without your machine running out of memory. That’s why streaming allows you to process data in smaller-sized chunks, one at a time, one after the other, so that at any given time you just have to deal with a fix-sized amount of data. You read the data into a helper variable over and over again and process it, until your underlying stream tells you that you are done and there is no more data left.

    The same works on the output side, you write your output step for step, chunk for chunk, rather than writing the whole thing at once.

    This concept brings other nice features, too. Because you can nest streams within streams within streams, you can build a whole chain of transformations, where each stream may modify the data until you finally receive the end result, not knowing about the single transformations, because you treat your stream as if there were just one.

    This can be very useful, for example C or C++ streams buffer the data that they read natively from e.g. a file to avoid unnecessary calls and to read the data in optimized chunks, so that the overall performance will be much better than if you would read directly from the file system.

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

Sidebar

Related Questions

A few of us at work have been reading some on Haskell and we
I'm new to EMR and just had a few questions i have been struggling
I've been reading about TransactionScope and had a question about its interoperability with ADO.Net
I have been reading a lot about Event Driven Architecture and it makes a
I've been reading about about code optimization (to be more precise, code optimization for
I know this question had been asked a hundred times, but I have difficulties
I have had been on a roller coaster trying to get ImageMagick to work
I have been trying to set up OpenCV for the past few days with
I've been using J for a few months now, and I find that reading
I been reading on asp.net mvc learning site about JavaScript injection and man it

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.