This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: different output from the gcc
- To: mahadev_kc at yahoo dot com
- Subject: Re: different output from the gcc
- From: pkurpis at keck dot hawaii dot edu (Peter Kurpis)
- Date: Mon, 16 Oct 2000 06:11:34 -1000 (HST)
- Cc: gcc-help at gcc dot gnu dot org
> the following program prints different outputs on the terminal.
>
> #include <stdio.h>
> int main()
> {
> int i=10, j=20;
> printf("%d %d");
> return 0;
> }
>
>
> on windows nt, prints : 38076236 1627415320
> on RH linux , prints : 20 10
> on sun solaris , prints : 67584 -1341572
Are you sure you don't mean printf("%d %d", i, j) ?
If you don't provide the arguments corresponding to
the printf control string, printf just scoops up
whatever happens to be on the stack, which is
(expectedly) system dependant. Or am I missing
something?