The boolean and operator in C and C++ is &&
a < 3 && b > 4 // relational
The bitwise and operator in C and C++ is &
maskresult = maskinput & maskvalue // bitwise
if you mean and in the condition statements the and operator is "&&"
but if you mean that AND in logic design like "0101+0001=0001" the operator is "&"
you can use the link: http://msdn.microsoft.com/en-us/library/z0zec0b2%28VS.71%29.aspx
// expre_Bitwise_AND_Operator.cpp
// compile with: /EHsc
// Demonstrate bitwise AND
#include <iostream>
using namespace std;
int main() {
unsigned short a = 0xFFFF; // pattern 1111 ...
unsigned short b = 0xAAAA; // pattern 1010 ...
cout << hex << ( a & b ) << endl; // prints "aaaa", pattern 1010 ...
}
All the logical operators in C++ are:
== (equals to)
!= (not equals to)
< (smaller than)
> (bigger than)
<= (smaller than or equals to)
>= (bigger than or equals to)
&& (and)
(or)
The logical operators is used to test if something is true. Example:
if(1 > 3)
{
cout << "Hello";
}
That will only happen if 1 is less that 3. Wich will always be true so it will execute no matter what.
There is no operator ' in C++. It is merely a token or symbol used to delimit literal characters:
char c = 'a';
The ' token is also known as a single quote, as opposed to " which is the double quote token which is used to delimit strings of characters:
char str[] = "Hello world";
To store a literal single quote in a character type, you must use the escape sequence \':
char c = '\''; quote, slash, quote, quote
However, single quotes can be used in strings without an escape sequence:
char str[] = "An ampersand ('&') literally means 'and'";
calloc operator,malloc operator
entirely different thingsconditional operator: ? : logical operators:AND: && OR: NOT: !also you can count XOR: != eg:if ((a==3) != (b==c)) printf ("XOR: Exactly one of the two conditions is true\n");
logical and: exp1 && exp2 means: exp1==0 ? 0 : exp2==0 ? 0 : 1
The only "special" operators in C++ are those that cannot be overloaded. That is; the dot member operator (.), pointer to member operator (.*), ternary conditional operator (:?), scope resolution operator (::), sizeof() and typeof().
There is no unary plus in C, but if there were, it would have only one operand, unlike the binary plus which has two: x = a + b; /* binary plus */ x = + b; /* unary plus -- not in C*/ x = a - b; /* unary plus */ x = - b; /* unary minus */
conditional operator , size of operator , membership operator and scope resulation operator can not be overload in c++
calloc operator,malloc operator
There is no "power" operator in C or C++. You need to the use the math library function pow().
+ is an example, one of many, of a binary operator in C or C++ a = b + c; // for usage example
There is no memory management operator in C++ -- it is an unmanaged language. You use the C++ new operator to allocate memory, and use the C++ delete operator to release previously allocated memory.
In C and in C++, the ++ operator means to increment. C++ was intended to be the next version, i.e. the incremental next step, of C, hence the use of the ++ operator.
The ++ in C++ refers to the postfix increment operator (operator++()). It's literal meaning is "the successor to C", in reference to the C language upon which the C++ language is based.
No.
entirely different thingsconditional operator: ? : logical operators:AND: && OR: NOT: !also you can count XOR: != eg:if ((a==3) != (b==c)) printf ("XOR: Exactly one of the two conditions is true\n");
logical and: exp1 && exp2 means: exp1==0 ? 0 : exp2==0 ? 0 : 1
type operator- ();
delete