473,751 Members | 2,368 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

cout implementation

hi all,

Is it true that the cout function used in C++ for printing data
to the console is implemented via the "write" system call?
If not then how the cout function is implemented?

Thanks,
Candice

Jul 22 '05 #1
1 1825
ca********@yaho o.com wrote:
Is it true that the cout function used in C++ for printing data
to the console is implemented via the "write" system call?
Maybe, or maybe not. That depens on the compiler/OS/library/...
Some OSs don't even have a "write" system call.
If not then how the cout function is implemented?


The C++ standard doesn't define that. It's up to the implemenation to decide
where the output of cout goes.

Jul 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
8274
by: Toro | last post by:
Hi, I want to control the output such that it always print at the same line, erasing the line just printed (or erasing a particular posistion at a certain line). Say, for a simple program like this, #include <StdAfx.h> #include <iostream.h> void main() { cout<<"Hello World"<<endl; cout<<":) " <<endl;
1
1513
by: regisser | last post by:
Is it true that cin,cout, etc are initialized on first use? And that no runtime initialization before main is needed; the first time the object is accessed, it grabs dynamic memory typically like 1K of memory? Thanks
5
2627
by: Marc Schellens | last post by:
I want to create an object, which replaces std::cout all output will be put out to std::cout, but optional also copied to a file. But the file output needs to be manipulated: every new line has to be preceded by a ';' Is there an easy way to do so? Or do I have to write wrappers for all kind of
3
3071
by: puzzlecracker | last post by:
In one of my applications, I was mixing perror (cerrno )with cout(iostream) calls and sometimes getting unordered output. The exact context was to print an error condition as well as cause for exceptions. Therefore, I resorted to .flush call in iostream that did the trick. Anyone can explain the root of all evil in intermixing the c++ with date c library, perhaps, give a link to where solutions to this problem are addressed? Why...
2
3043
by: nrhayyal | last post by:
Hello experts, are cout and printf and other ostream and stdio functions/libraries are threadsafe? i am using gnu gcc3.3.2 on AIX5.2. and my applications are multithreaded applications. i am using -lpthread as one of the compiler option. i am using cout and printf for debugging purpose. thanks for ur replies in advance. Thanks and Regards
2
4490
by: Hai Ly Hoang [MT00KSTN] | last post by:
I have a C++ console program which has a lot of output (no input) like this: cout << "Strings here". Now i want to turn this application to windows application (with gui) and I want to bring the output of cout << "string" to a rich text box. Because of a great quantity of cout, i don't and can't change each cout << code. I need some mechansim (like pipe or hook into << command) to direct the output of cout << into the rich text box....
12
6108
by: Filipe Sousa | last post by:
Hi! Could someone explain to me why this operation is not what I was expecting? int main() { int x = 2; std::cout << x << " " << x++ << std::endl; return 0; }
2
7769
by: Ralf Goertz | last post by:
Hi, can I mix output to cout and wcout? It seems that if I write to cout first it works fine but if I start with wcout the output to cout vanishes. I assume that is has to do with the initialization of standard output, right? #include <iostream> using namespace std;
3
551
by: worlman385 | last post by:
why when I use cout, I must put - using std::cout; #include <iostream> using std::cout; if i look at iostream, it seem cout is defined in iostream - __PURE_APPDOMAIN_GLOBAL extern _CRTDATA2 ostream cout; I also see _STD_BEGIN
58
4841
by: Mark Casternoff | last post by:
I'm getting back into C++ after a long hiatus (they didn't have namespaces back then). I know this question is completely subjective, but I'd be interested in hearing which is the "better" style and what the pros and cons are (I'm using cout as example, but it really applies to any similar construct): 1) using std::cout;
0
9006
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9587
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9405
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8268
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6819
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6086
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4897
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2813
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2230
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.