This is the mail archive of the
mailing list for the GCC project.
Re: is the c code in gcc comiled sequentially???
enggakshat <firstname.lastname@example.org> 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.
> 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";