Question mark in a code

Hi everybody,
While I was working i came across a code which was written by somebody else. I see a function defined in a class as

[void CCommandHandling::nGetTXTransforms(bool bReturn0x0800Option)
{
int nReplyMode = 0x0001,
char m_szCommand[1024];

nReplyMode = bReturn0x0800Option ? 0x0801 : 0x0001;

memset(m_szCommand, 0, sizeof(m_szCommand));
sprintf( m_szCommand, "TX %04X", nReplyMode);
} ]
I really can't understand this statement:
[ nReplyMode = bReturn0x0800Option ? 0x0801 : 0x0001;]

Is there someone who can help?

Thanks
The expression a ? b : c returns b if a is true, otherwise it returns c.
Thank you very much!
and the statement:

sprintf( m_szCommand, "TX %04X", nReplyMode)

puts in the string m_szCommand the string
TX 0x0001
with zero pad on the left if bReturn0x0800Option is false.

Am I right?
Yes.

PLEASE USE CODE TAGS (the <> formatting button) when posting code.
It makes it easier to read your code and also easier to respond to your post.
http://www.cplusplus.com/articles/jEywvCM9/
Hint: You can edit your post, highlight your code and press the <> formatting button.
Topic archived. No new replies allowed.