Re: printf execution problem



rahul8143@xxxxxxxxx wrote:
David Resnick wrote:

rahul8...@xxxxxxxxx wrote:

Does printf output depends on compilers or operating systems? I have
one program
int main()
{
int i=5;
printf("%d %d %d",i++,i++,i++);
return 0;
}

<snip>

Learn to read the group and FAQ before posting, this is asked all the
time.
http://www.eskimo.com/~scs/C-faq/q3.2.html


I have first read above link and then decided to ask question. The link said that such programs behaviour is undefined and depends on compiler. But i thought that is there any hidden relationship of this behaviour to OS.

There may be, there may not. It really does not matter. All that matters is that you never do anything like the above.


> Nowadays no one uses DOS but everybody says to use GCC
but most people also uses VC++. so doesn't it create a war of
compilers(which to use?)

Whichever you want, from the point of view of this group it makes little difference since both can do a reasonable job of compiling code that conforms to C89 and producing diagnostics where required. Each has advantages and disadvantages. The best place to discuss the relative merits of compilers for Windows, DOS or any other system is in a group dedicated to that system.
--
Flash Gordon
Living in interesting times.
Although my email address says spam, it is real and I read it.
.




Relevant Pages

  • Re: Bug/problem with lcc-win
    ... layer or through using a sufficiently old version of win32, ... which is a 16 bit DOS emulation mode (which does ... Who writes a Win32 compiler and is ... unfamiliar with the basic execution modes of Windows? ...
    (comp.lang.c)
  • Re: Dos programming
    ... version of DOS, a DOS compiler, a DOS graphics library)? ... stuff in their time that was little known outside the cult-like OS/2 ... a certain compiler (since all have strengths and weaknesses, ... figure out which assembler to use, ...
    (comp.os.msdos.djgpp)
  • Re: CE virgin, looking for guidance in finding things
    ... compiler. ... Something that will handle TCP and UDP. ... Something that doesn't get into memory models, a la DOS. ... As far as I can tell; DOS violates, unix violates, and ...
    (microsoft.public.windowsce.embedded.vc)
  • Re: bug in Aztec C 1.05i for Apple DOS
    ... The Aztec C DOS 3.3 Shell is supported only by this compiler so ... for compatability of shell programs this is the only choice. ...
    (comp.sys.apple2.programmer)
  • DJGPP and FreeBASIC
    ... GPL multiplatform basic compiler. ... We have a full port of FreeBASIC to DOS using the DJGPP development system. ... I have built this package using djdev204 but I have no ...
    (comp.os.msdos.djgpp)