Tech Stuff with Rybo
An overview of technical problems and my solutions for them.
Showing posts with label
C# Operators
.
Show all posts
Showing posts with label
C# Operators
.
Show all posts
Monday, June 15, 2009
Question Mark Operator C#
The question mark operator is a 'ternary' operator that allows a conditional statement to be written in one line.
if a function returns a boolean :
return someVar == anotherVar ? true : false;
is equivalent to
if(someVar == anotherVar)
{
return true;
}
else
{
return false;
]
Older Posts
Home
Subscribe to:
Posts (Atom)