473,394 Members | 1,781 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

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
2 3895
The implementation of cout is up to the person doing the
implementation. On UNIX (and similar) systems, it probably does use
write. On other systems, there is no system call named 'write'...

--
Later,
Jerry.

The universe is a figment of its own imagination.

Jul 22 '05 #2

ca********@yahoo.com wrote:
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?


In Windows it will probably be WriteConsoleA; it doesn't have
a write() system call. Other systems don't have WriteConsoleA
so they may use other system calls. In DOS, you don't even
need a system call. You can simply create a pointer to the
screen and just copy the bytes.

Regards,
Michiel Salters

Jul 22 '05 #3

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

Similar topics

12
by: Me | last post by:
Hi, I would like learn from people with experience in C++, which of the following styles of way to construct "get/set" member functions would be the best in terms of usability, speed, et cetera. ...
3
by: forums_mp | last post by:
After reading a few texts - nameley koeing/moo and eckel - I decided to investigating the importance of templates. Of course there's no substitute for practice so I figured I try a simple program....
1
by: candy_init | last post by:
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,...
3
by: Thomas Ibbotson | last post by:
I've been going through a tutorial on C++ and I've come across what I regard as some strange behaviour. As part of the tutorial on classes a simple stack is implemented with functions push() and...
5
by: christophe (dot) poucet (at) gmail (dot) com | last post by:
Hello, I noticed there is a flaw in the vector implementation of g++ (3.4). Basically when you erase an element from a vector, it calls the wrong destructor. In most cases this is not such a...
12
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; }
3
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...
17
by: Ankur Arora | last post by:
Hi All, I'm building a sample application that uses a custom auto_ptr implementation. The program crashes with the following output:- Output (Debug Assertion failed) ----------
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.