Q:

C++ SDL What does the | do?

screen = SDL_SetVideoMode(1000,1000,32, SDL_HWSURFACE | SDL_FULLSCREEN);

What does the | do in SDL_HWSURFACE | SDL_FULLSCREEN? (I tried googling this but google wont accept special characters..)

A:

C / C++ APIs often set up bit 'flags' when there are a lot of different, non-mutually exclusive options that can be set for a given function call.  Each of the flags will be assigned a bit position in a value (often a DWORD or other large integer type).  One or more of these bits can then be set by bitwise OR-ing a collection of defined constants that represent the options and give you a more clear label to identify them than a raw numeric constant.  The resultant value is passed as a single argument to the API function, which helps to keep the signature manageable.
In this particular case, SDL_HWSURFACE and SDL_FULLSCREEN represent options that can be passed in to the SDL_SetVideoMode call.  There are probably several other possible options available as well that were not set in this case.  This particular call sets the two options by bitwise OR-ing the flag constants together, and passing the result as the last parameter.

A:

That's the bitwise OR operator. It applies it to SDL_HWSURFACE and SDL_FULLSCREEN.

A:

The other answers have explained it's a bitwise OR, but you probably want to know how that works:
The flags are passed as a binary number, like 00001000 or 01000000, and each bit represents an individual flag. So the first bit (0) means HW_SURFACE is off, and the second bit (1) means FULLSCREEN is on. (Note that these are examples, I'm not sure about the actual bits.)
So what the bitwise OR function does is combine those two flags by comparing each bit and saying "Is this bit OR this bit 1?" and if either is 1, it will set the result to 1. This will provide the result 01001000 which can be parsed by SDL to set the appropriate flags.

