From: enggakshat <enggakshat@yahoo.com>
To: gcc-help@gcc.gnu.org
Subject: Re: is the c code in gcc comiled sequentially???
Date: Wed, 15 Nov 2006 17:57:00 -0000 [thread overview]
Message-ID: <7362882.post@talk.nabble.com> (raw)
In-Reply-To: <m3irhgwwot.fsf@localhost.localdomain>
Ian Lance Taylor-3 wrote:
>
> enggakshat <enggakshat@yahoo.com> writes:
>
>> for the following simple code i thought its obvious that 'hello' is
>> printed
>> but that doesnt happen.
>> as far as i knew the code is executed sequentially.
>>
>> #include<iostream>
>>
>> using namespace std;
>>
>> int main()
>>
>> {
>> int i=0;
>> cout<<"hello";
>> while(1)
>> {
>> i++;
>> }
>> }
>
> 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";
>
> Ian
>
>
thanks a lot .it worked.is there any suggested reading from where i can get
more info on buffers in c++
regards
Akshat
--
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.
next prev parent reply other threads:[~2006-11-15 17:57 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-15 6:13 enggakshat
2006-11-15 12:20 ` John Love-Jensen
2006-11-15 15:07 ` enggakshat
2006-11-15 15:35 ` Ian Lance Taylor
2006-11-15 17:57 ` enggakshat [this message]
2006-11-15 19:18 ` Young, Michael
2006-11-15 15:38 ` John Love-Jensen
2006-11-15 17:55 ` enggakshat
2006-11-15 16:15 Kaz Kylheku
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7362882.post@talk.nabble.com \
--to=enggakshat@yahoo.com \
--cc=gcc-help@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).