Search code examples
c++outputiostreamcout

How many chars or characters , or bytes of data std::cout can output at once?


I am learning C++, so you are very right to assume that I am new to C++ and programming as well.

I am trying to understand iostream library, not the whole, but the things that newcomers must know before jumping into another topic. My understanding of std::cout is that it is a variable that holds bunches of chars or value of other variables for outputting into the console.

Now I am curious to know maximum number of chars as a string--giving directly(like std::cout <<"hello\n"--it(std::cout) can output to the console.


Solution

  • There is no specified limit. There may be a practical implementation specific limit. Most likely, it will be way more than you'll need.

    Note that std::cout streams to standard output. While that is often displayed in console, that is not necessarily the case.