By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,988 Members | 1,017 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,988 IT Pros & Developers. It's quick & easy.

Is this ANSI? x <?= y

P: n/a
Hi there!
I recently come upon the expression:
x <?= y;
I guess this means : if (x>y) {x = y;} just in a *weird* fashion
But maybe is not weird at all, but the *guru* way ..like while(*p++)
{}...
It doesn't compile even in the last VC++ 2005 (but again)
who real *guru* uses that? And I only could test this in g++.
Is this ANSI?, has any advantages apart of typing less characters?
Has wide support?.
Sorry if this was answered yet, I searched in google and it ignores the
"<?=" tag...

Sep 19 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
_ex_ wrote:
I recently come upon the expression:
x <?= y;
I guess this means : if (x>y) {x = y;} just in a *weird* fashion
But maybe is not weird at all, but the *guru* way ..like while(*p++)
{}...
It doesn't compile even in the last VC++ 2005 (but again)
who real *guru* uses that? And I only could test this in g++.
Is this ANSI?
No.

Best regards,

Tom

Sep 19 '06 #2

P: n/a
_ex_ <ex*****@gmail.comwrote:
Hi there!
I recently come upon the expression:
x <?= y;
I guess this means : if (x>y) {x = y;} just in a *weird* fashion
But maybe is not weird at all, but the *guru* way ..like while(*p++)
{}...
It doesn't compile even in the last VC++ 2005 (but again)
who real *guru* uses that?
Do you know? The compiler is better than you seem to think.
And I only could test this in g++.
Is this ANSI?, has any advantages apart of typing less characters?
Has wide support?.
Sorry if this was answered yet, I searched in google and it ignores
the "<?=" tag...
It is not valid. If gcc accepts it, it is an extension of that
compiler. Do not use it if you want to stay portable.

hth
--
jb

(reply address in rot13, unscramble first)
Sep 19 '06 #3

P: n/a
It's a gcc extension for C++. <? is the "minimum" operator, >? is the
"maximum" operator. Both were deprecated on gcc 4.0.

Sep 20 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.