473,387 Members | 1,453 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Are these operators in C ?

AmberJain
884 Expert 512MB
I found these OPERATORS ("PROBABLY this is right name for them") mentioned in an online tutorial for C--------->
__________________________________________________ _______________
1. |=
2. ^=
3. &=
4. <<=
5. >>=
__________________________________________________ _______________
Are these operators in C? Somebody please explain them in a bit detail.... I could not find them mentioned in the book I'm referring to.

NEWBIE HERE......PLZ HELP

THANKS TO EVERYONE IN ADVANCE................
Mar 5 '08 #1
4 1345
weaknessforcats
9,208 Expert Mod 8TB
What does your compiler have to say about this?

Write a code snippet and see.
Mar 5 '08 #2
Ganon11
3,652 Expert 2GB
The first three look like bitwise operators to me. The last two look like bit shift operators. But what's with the equals sign?

I also don't get the equals sign in +=, -=, *=, /=,...hmm, maybe there's a connection...
Mar 5 '08 #3
Parul Bagadia
188 100+
Even i dont know about those operators; but i can tell you about these;
+=, *=,/=, -=;
these all are used for postincrementing the operands,
for ex.
i+=1;
means; i=i+1;
these goes for rest of the above mentioned operators; so may be its the same thing for all those u hav mentioned. But i dont know about them; but m sure regarding this.
Mar 5 '08 #4
AmberJain
884 Expert 512MB
I found this in my compiler's (BORLAND Turbo C++ 3.0) help manual and thought it would be nice to post it here. This solves my problem also------------->

Assignment operators ------------------>

There are 11 assignment operators in Turbo C++.

The = operator is the simple assignment operator; the other 10 are known as
compound assignment operators.

This is the complete set of assignment operators:

=
*= /= %= += -=
<<= >>= &= ^= |=

Syntax:
unary-expr assignment-op assignment-expr

In the expression E1 = E2, E1 must be a modifiable lvalue.

The value of E2, after conversion to the type of E1, is stored in the object
designated by E1 (replacing E1's previous value).

The value of the assignment expression is the value of E1 after the
assignment.

The assignment expression is not itself an lvalue.

For both simple and compound assignment, the operands E1 and E2 must obey
one of the following sets of rules:

1. E1 is of qualified or unqualified arith-
metic type and E2 is of arithmetic type.

2. E1 has a qualified or unqualified version
of a structure or union type compatible
with the type of E2.

3. E1 and E2 are pointers to qualified or
unqualified versions of compatible types,
and the type pointed to by the left has
all the qualifiers of the type pointed to
by the right.

4. One of E1 or E2 is a pointer to an object
or incomplete type and the other is a
pointer to a qualified or unqualified
version of void.

The type pointed to by the left has all
the qualifiers of the type pointed to by
the right.

5. E1 is a pointer and E2 is a null pointer
constant.

The compound assignments are op=, where op can be any one of the ten
operator symbols

* / % + -
<< >> & ^ |

The expression

E1 op= E2

has the same effect as

E1 = E1 op E2

except that the lvalue E1 is evaluated only once. For example, E1 += E2 is
the same as E1 = E1 + E2.
Mar 8 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

14
by: greg | last post by:
Discussion is invited on the following proto-PEP. ------------------------------------------------------------- PEP ??? - Overloadable Boolean Operators...
4
by: GianGuz | last post by:
Global new and delete operators can be overloaded to suite particulars needs. Typically they are overloaded to insert useful debugging/trace informations. What I would to discuss here concerns the...
6
by: bearophileHUGS | last post by:
Sometimes I suggest to add things to the language (like adding some set methods to dicts), but I've seen that I tend to forget the meaning of six set/frozenset operators: s & t s &= t s | t s...
6
by: jas_lx | last post by:
The basic understanding of what bitwise operators (& ^ | >> << ) comes fairly simple, as long as one has a fundamental understanding of bits, bytes and binary. Having done some Win32...
2
by: Steve Summit | last post by:
-----BEGIN PGP SIGNED MESSAGE----- It's often explained that the reason for some of the imprecision in C's definition is so that C can be implemented on different kinds of machines -- say, those...
49
by: raju | last post by:
hi can we compare two integers without using relational operators (== != < <= > >=) thanks rajesh s
0
by: Syanide | last post by:
here's a bit info for you fellas: eg.. you have Square classes u wanna add public static int operator+ (Square s1, Square s2) { // your code here } comparision operators..
17
by: Steve R. Hastings | last post by:
I have been studying Python recently, and I read a comment on one web page that said something like "the people using Python for heavy math really wish they could define their own operators". The...
28
by: dspfun | last post by:
I'm trying to get a good understanding of how unary operators work and have some questions about the following test snippets. int *p; ~!&*++p--; It doesn't compile, why? The problem seems to be...
18
by: Zach | last post by:
Can someone list the various macro operators and what they mean. Came across a function macro: #define max(a, b) ((a)>(b)?(a):(b)) What does "?" amd ":" mean in this statement? Zach
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.