Hi

Yes my friend Gothic said it ....They are called Bitwise Operators.....because they operate on individual bits.......

Operator Meaning

~ :::::: One's Compliment

>>:::::: Right Shift

<<:::::: Left Shift

& :::::: Bitwise "AND"

| :::::: Bitwise OR

^ :::::: Bitwise XOR



Can we have the whole code please.......

until then Lest see what this code here does..it's performing some operation on the year part of the date(my interpretation of the code i could be wrong) ..........

y = (mdy>>9) && 0x7f + 1900;

this would be evaluated as ((mdy>>9) && 0x7f) + 1900 so i will maintaiin the sequence

mdy>>9

This would Shift all the bits in mdy nine places to the right

for e.g. if mdy=11010111
then mdy>>1 =01101011
Similarly mdy>>2=00110101

I belive by right shift what ists trying to do is get the Year out of the variable mdy(month day Year)

it should be something like this

Code:

0  0   0   1   0  1   0    0    0    1   1   0    1     0    0   1      

|<------- Year-------->|<-----Month----->|<---------day---------->|

If we right Shift By 9 we Get the Yesr

0  0   0   0   0  0   0    0    0    0   0   0    1     0    1   0      

                                          |<--------Year-------->|



&&0x7f

"I believe that when you use && like that it compares each bit and ands it, but I could be wrong."

"&&" is a Logical "AND" operator Not Bitwise.......i am not sure if it would be evaluated as the bitwise operator "&"..i will check it as soon as get my hands on a C++ compiler........

ok made a small program to test that and Gothic sorry but you seem to be wrong there from what i am getting......works in TurboC++ can't take responcibility or any other C++ compilers.......

Code:
#include<iostream.h>
#include<conio.h>

showbits(int);

void main()
{
	int i,j,k;

	k=9;
	i=40;

	clrscr();

	showbits(i);
	cout<<endl;
	showbits(k);
	cout<<endl;

	j=i&k;
         //j=i&&k;
	showbits(j);
	cout<<endl;

getch();
}

//This Function Will Print the Binary of any Integer 
or Character that is Passed to it as the parameter.....
showbits(int n)
{
	int i,k,andmask;

	for(i=15;i>=0;i--)
	{
		andmask=1<<i;
		k=n&andmask;

		k==0?cout<<"0":cout<<"1";
	}
return;
}

Output

case 1 ::   i & j 

The Result :: i=0000000000101000
              j=0000000000001001
               -------------------
                0000000000001000

Case 2 :: i && j

The Result :: i=0000000000101000
              j=0000000000001001
              --------------------
                0000000000000001

+ 1900

I don't think it needs any explaination..............

-Good Luck--