Wrox Programmer Forums
|
BOOK: Beginning Visual C# 2012
This is the forum to discuss the Wrox book Beginning Visual C# 2012 by Karli Watson, Jacob Vibe Hammer, Jon Reid, Morgan Skinner, Daniel Kemper, Christian Nagel, ; ISBN: 978-1-118-31441-8
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Visual C# 2012 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 10th, 2014, 10:37 PM
Registered User
 
Join Date: Dec 2014
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Boolean Assignment Operators



Chapter 4, page 52

I'm not sure I understand how boolean assignment operators work. The table here, indicates (in the result column) that var2 is in some way being added to var1. However, based on previous pages, my understanding says different.


var1 &= var2; /* If I understand correct, then var1 is true only if var1 and var2 are both true */

var1 |= var2; /* var1 is true if either var1, var2, or both are true. */

var1 ^= var2; /* var1 is true if either var1 OR var2 is true, but not both. */


The way the first line of the table is written, it looks like you are adding var1 to var2. var1 &= var2; "var1 is assigned the value that is the result of var1 & var2." This looks like var1 = var1 + var2. Almost identical wording for the other two lines in that table make it more confusing.

The three lines I placed in the second paragraph is my best guess at what is meant here. Please tell me if I am correct, and if not, can you explain Boolean Assignment Operators better to me?





Similar Threads
Thread Thread Starter Forum Replies Last Post
please help me out with this assignment... vaidehi BOOK: Beginning Linux Programming, 4th Edition ISBN 978-0-470-14762-7 3 September 10th, 2008 03:57 PM
assignment pooja85jain SQL Language 1 September 2nd, 2006 11:09 AM
Programming assignment. Neeko C++ Programming 16 December 18th, 2005 09:48 AM
Java assignment greeny Java Basics 0 November 29th, 2005 08:29 AM
Java assignment greeny JSP Basics 0 November 29th, 2005 08:26 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.