cout implementation

C

candy_init

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
 
J

jcoffin

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'...
 
M

msalters

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,184
Messages
2,570,978
Members
47,578
Latest member
LC_06

Latest Threads

Top