Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Doing both functions in &&

Reply
Thread Tools

Doing both functions in &&

 
 
EvilOldGit@googlemail.com
Guest
Posts: n/a
 
      04-13-2007
Is it defined in the standard that when evaluating && that if the
first operand is false it doesn't bother operating the other ?
Ditto ||

 
Reply With Quote
 
 
 
 
Victor Bazarov
Guest
Posts: n/a
 
      04-13-2007
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> Is it defined in the standard that when evaluating && that if the
> first operand is false it doesn't bother operating the other ?
> Ditto ||


Yes.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask


 
Reply With Quote
 
 
 
 
Default User
Guest
Posts: n/a
 
      04-13-2007
(E-Mail Removed) wrote:

> Is it defined in the standard that when evaluating && that if the
> first operand is false it doesn't bother operating the other ?


Yes, it's called short-circuit evaluation.

> Ditto ||


Well, something similar. If the first operand is true, it doesn't
bother with the second.




Brian

 
Reply With Quote
 
Andre Kostur
Guest
Posts: n/a
 
      04-13-2007
"Victor Bazarov" <(E-Mail Removed)> wrote in news:evorvm$9t$1
@news.datemas.de:

> (E-Mail Removed) wrote:
>> Is it defined in the standard that when evaluating && that if the
>> first operand is false it doesn't bother operating the other ?
>> Ditto ||

>
> Yes.


Unless operator&& is a user-defined operator. (I know, doesn't help for
basic types....)
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Doing both regex match and assignment within a If loop? Victor Hooi Python 7 03-29-2013 01:49 PM
compilation error: file exists in both in both 'c:\WINNT\Microsoft.NET\Framework\v2.0.50727 ABCL ASP .Net 0 05-29-2008 04:59 PM
2 computers, both online, both invisible to each other ? b Computer Support 9 04-21-2006 04:06 AM
What is difference between Switch and Router?. Both functions are part of H/W or S/W?. GS Cisco 9 04-28-2005 08:52 PM
please help me in distinguish redefining functions, overloading functions and overriding functions. Xiangliang Meng C++ 1 06-21-2004 03:11 AM



Advertisments