On 07/08/2015 08:26 PM, walt wrote:
I'm trying to debug a gtk+ app so I'm trying to learn some basic gtk+
and failing :(

Can anyone splain to me what these lines mean:

typedef enum
{
   G_CONNECT_AFTER       = 1 << 0,
   G_CONNECT_SWAPPED     = 1 << 1
} GConnectFlags;

In particular I don't understand what the << operator is doing.

When I was young << meant bitwise shift to the left.  When I got old
and tried to learn c++ it was a way to print a string to the terminal.

Any clues would be welcome.  <type slowly and use small words, please>




Bit shift. gtk+ is written in C, so '<<' is always bit shifting. Enums are basically constants, and they're hardcoding the values so they can be OR'd together.

Alec

Reply via email to