Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 08 Jul 2020 11:42:44 +0000
From:      "Poul-Henning Kamp" <phk@phk.freebsd.dk>
To:        rahul deshmukh <rahul.dshmkh1@gmail.com>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: strange output in c program
Message-ID:  <60590.1594208564@critter.freebsd.dk>
In-Reply-To: <CAFa7P3fnvqCWfPJU-moJEyx0Wx=bL0sRjhMKLkyiBvN9k6ReSg@mail.gmail.com>
References:  <CAFa7P3fnvqCWfPJU-moJEyx0Wx=bL0sRjhMKLkyiBvN9k6ReSg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
--------
rahul deshmukh writes:

> #include <stdio.h>
> int main()
> {
>     int a = 300, b, c;
>     if(a >= 400)
>     {
>         printf("shouldn't print\n");
>         b = 300;
>     }
>     c=200;
>     printf("%d %d\n", b, c);
>     return 0;
> }
> =========================================================
> rdx@FreeBSD:~/Projects/Clang/chapter3 % make example6
> `example6' is up to date.
> rdx@FreeBSD:~/Projects/Clang/chapter3 % ./example6
> 300 200==> should be garbage value instead of 300?

300 is a perfectly valid garbage value :-)

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk@FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?60590.1594208564>