This is the mail archive of the
mailing list for the GCC project.
RE: is the c code in gcc comiled sequentially???
- From: "Young, Michael" <Michael dot Young at paetec dot com>
- To: "enggakshat" <enggakshat at yahoo dot com>, <gcc-help at gcc dot gnu dot org>
- Date: Wed, 15 Nov 2006 14:18:48 -0500
- Subject: RE: is the c code in gcc comiled sequentially???
I recommend Langer and Kreft's book, "Standard C++ IOStreams and Locales:
Advanced Programmer's Guide and Reference" for a full explanation of iostreams
and the underlying classes.
Be aware that flush (which writes out any buffered characters) is invoked by endl,
so any statements written similar to the following should work as you were
std::cout << "your text here" << std::endl ;
From: firstname.lastname@example.org [mailto:email@example.com]On
Behalf Of enggakshat
Sent: Wednesday, November 15, 2006 12:58 PM
Subject: Re: is the c code in gcc comiled sequentially???
Ian Lance Taylor-3 wrote:
> enggakshat <firstname.lastname@example.org> writes:
>> for the following simple code i thought its obvious that 'hello' is
>> but that doesnt happen.
>> as far as i knew the code is executed sequentially.
>> using namespace std;
>> int main()
>> int i=0;
> This is most likely a buffering issue. std::cout is normally line
> buffered by default, which means that it is only flushed when you
> output a newline character. Try this:
> cout << unitbuf << "hello";
thanks a lot .it worked.is there any suggested reading from where i can get
more info on buffers in c++
View this message in context: http://www.nabble.com/is-the-c-code-in-gcc-compiled-sequentially----tf2634251.html#a7362882
Sent from the gcc - Help mailing list archive at Nabble.com.