About Question enthuware.ocajp.i.v7.2.973 :

All the posts and topics that contain only an error report will be moved here after the error is corrected. This is to ensure that when users view a question in ETS Viewer, the "Discuss" button will not indicate the presence of a discussion that adds no value to the question.

Moderators: Site Manager, fjwalraven

Post Reply
zippo1000
Posts: 2
Joined: Mon Jun 24, 2013 5:59 am
Contact:

About Question enthuware.ocajp.i.v7.2.973 :

Post by zippo1000 »

In the explanation there are the following examples:

Code: Select all

( true || bool = false)
( true |  bool = false)
It is said that the first one wouldn't assign false to 'bool', whereas the second does. Unfortunately the compiler complains about these expressions. The reason is, that || and | comes before =. (--> operator precedence)

Maybe I miss something but I think it should be changed to the following:

Code: Select all

( true || (bool = false))
( true |  (bool = false))

Daniel Clinton
Posts: 29
Joined: Fri Aug 08, 2014 11:22 am
Contact:

Re: About Question enthuware.ocajp.i.v7.2.973 :

Post by Daniel Clinton »

I think so too.
Assignment has the lowest precedence of all operations.
Both cases need parentheses to compile

admin
Site Admin
Posts: 10389
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.ocajp.i.v7.2.973 :

Post by admin »

You are right. Fixed.
thank you for your feedback!

Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests