Related articles |
---|
[13 earlier articles] |
Re: What is the meaning of an expression? christopher.f.clark@compiler-resources.com (Christopher F Clark) (2022-01-19) |
Re: What is the meaning of an expression? tkoenig@netcologne.de (Thomas Koenig) (2022-01-19) |
Re: What is the meaning of an expression? gah4@u.washington.edu (gah4) (2022-01-19) |
Re: What is the meaning of an expression? DrDiettrich1@netscape.net (Hans-Peter Diettrich) (2022-01-20) |
Re: What is the meaning of an expression? tkoenig@netcologne.de (Thomas Koenig) (2022-01-22) |
Re: What is the meaning of an expression? dave_thompson_2@comcast.net (2022-01-30) |
Re: What is the meaning of an expression? johann@myrkraverk.invalid (Johann 'Myrkraverk' Oskarsson) (2022-02-03) |
From: | Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> |
Newsgroups: | comp.compilers |
Date: | Thu, 3 Feb 2022 12:50:15 +0000 |
Organization: | Easynews - www.easynews.com |
References: | <AdgJPKhi/NiNfECvRNaA6+4Wq/M8OQ==> 22-01-052 22-01-058 |
Injection-Info: | gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="82992"; mail-complaints-to="abuse@iecc.com" |
Keywords: | C, standards |
Posted-Date: | 03 Feb 2022 15:14:27 EST |
Content-Language: | en-US |
In-Reply-To: | 22-01-058 |
On 1/15/2022 2:21 PM, matt.ti...@gmail.com wrote:
> Of course, expressions in most languages can also include function calls and
> operators that produce side effects, like "printf("%d",++i);", which certainly
> has a meaning even though it produces no meaningful value.
Actually, it does. It returns the number of characters written, or -1
on error. Therefore, you can write a /meaningful/ hello world like
this,
int main( int argc, char *argv[] ) { return printf( "hello\n" ); }
Of course, people generally don't like to put the return before the
printf(), and there's no telling what the operating system will do;
think OpenVMS.
--
Johann | email: invalid -> com | www.myrkraverk.com/blog/
I'm not from the Internet, I just work there. | twitter: @myrkraverk
Return to the
comp.compilers page.
Search the
comp.compilers archives again.