string manipulation with ? and : - where is the reference ?

I saw this in a sample program, but can't find anything in the ref manual about it. Looks really neat, though so would like to use it more, seems to be similar to switch/case.

Serial.println ((optionSwitch & mask) ? "closed" : "open");

Yes, you have to find a more complete C++ reference. There are many online.

a search for c++ conditional ? : led me to MSDN where all was explained. Thanks. (just had to blunder into the fact that it is a conditional....)

It's called -

ternary-operator

Call it a conditional expression, the same way you call + addition rather than binary operator.

Here is a run down of its uses (its entire usefulness is not well known or covered by other examples): http://arduino.land/FAQ/content/2/27/en/what-does-this-code-do-a-%3D-x-y-z.html

OK, what you need is a basic primer on C/C++. Like this one.

There are many, many others. Or you could buy the brown book, although they changed the cover a few years back so it's nowhere near as cool as it used to be. (I learned C from the blue book, back in the day).

In any case, nostalgia aside, the page from that tutorial describing the ternary operator is this one. Look through the whole thing.

GordB:
I saw this in a sample program, but can't find anything in the ref manual about it. Looks really neat, though so would like to use it more, seems to be similar to switch/case.

Serial.println ((optionSwitch & mask) ? "closed" : "open");

What that does is simplify an "if" type set of instructions. For example, look at this code example for a hypothetical temperature controller project:

var t = readTempSensor();
if (t > 70) {
    setHeater (0); // hotter than 70, turn heater off
} else {
    setHeater (1); // 70 or less, turn heater on
}

Now we will do the same thing using the ternary operator (the ? and : thing):

var t = readTempSensor();
setHeater ((t > 70) ? 0 : 1); // turn heater off or on

How that operator works is like this:

if THING is TRUE then do THIS otherwise do THAT

In the second code example, "thing" is the statement "t > 70". So if t is indeed greater than 70 (i.e. "true") then we pass the "0" to setHeater, meaning "we are at or above 70, so turn the heater off". If t is less than or equal to 70 (i.e. "false") then we pass the "1" to setHeater.

Another example could be:

RAINING ? USE_UMBRELLA : DON'T_NEED_UMBRELLA;

If "RAINING" is true (i.e. it's wet out) then do what follows the "?", otherwise do what follows the ":".

Make sense?

Hope this helps.