I can't seem to find what I need on google, and bet I'll get quick answer here.
String str;
bool b = true;
b ? str="true" : str="false";
Console.Out.WriteLine(str);
that ? : syntax looks correct to me. I'm getting compiler error though.
Program.cs(13,28):
error CS1002: ; expected
Program.cs(13,28):
error CS1525: Invalid expression term ':'
Program.cs(13,30):
error CS1002: ; expected
Not sure about the csharp syntax, but that builds in cpp. Please help! thanks!
UPDATE: About 10 of you give the correct answer LOL, so I'll just award to the first person who submitted it.
interesting Syntax, and I think I actually like it better than c++ syntax.
The actual code I was doing this for is:
ftp.ConnectMode = job.FTPUsePassiveMode ? FTPConnectMode.PASV : FTPConnectMode.ACTIVE;