Syntax Meaning of (x)(y) and x | y

What do these two types of syntax mean?

wndClass.hbrBackground = ( HBRUSH )( COLOR_WINDOW + 1 );

wndClass.style = CS_HREDRAW | CS_VREDRAW;
1. Cast the result of the expression on the right to type HBRUSH
http://www.cplusplus.com/doc/tutorial/typecasting/
This is a C-style cast and is discouraged in C++

2. Bitwise OR operatation
http://www.cplusplus.com/doc/tutorial/operators/#bitwise
Rarely used in C++
Last edited on
Topic archived. No new replies allowed.