13.07.2015 Views

BABAR C++ Course Running the Examples - HEPHY

BABAR C++ Course Running the Examples - HEPHY

BABAR C++ Course Running the Examples - HEPHY

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CharactersBitwise OperatorsC/<strong>C++</strong> only has single byte charactersConstants of type char use single quotesUse escape sequence for unprintable characters andspecial cases• ’\n’ for new line• ’\’’ for single quote• ’\”’ for double quotes• ’\?’ for question markchar a = ’a’;char aa = ’A’;• ’\ddd’ for octal number• ’\xddd’ for hexadecimalBoth Fortran and C/<strong>C++</strong> have bitwise operatorsFortran Purpose C/<strong>C++</strong>NOT(I) complement ~iIAND(I,J) and i&jIEOR(I,J) exclusive or i^jIOR(I,J) inclusive or i|jISHFT(I,N) shift left in• can be used on any integer type(char, short, int, etc.)• most often used for on-line DAQ and trigger• also used for unpacking compressed data<strong>BABAR</strong> <strong>C++</strong> <strong>Course</strong> 15 Paul F. Kunz<strong>BABAR</strong> <strong>C++</strong> <strong>Course</strong> 16 Paul F. Kunz

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!