Official Everybody Edits Forums

Do you think I could just leave this part blank and it'd be okay? We're just going to replace the whole thing with a header image anyway, right?

You are not logged in.

#1 2015-09-08 01:13:12

ParadoxInTheVoid
Member
From: ̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺
Joined: 2015-02-18
Posts: 341

[Quick Question] Boolean thing

Can someone tell me what it's called when you do the following:

Console.WriteLine(hasInternet ? "You have an internet connection." : "You don't have an internet connection."); // hasInternet is just an example boolean

signature.png

Offline

#2 2015-09-08 02:29:58

SirJosh3917
Formerly ninjasupeatsninja
From: USA
Joined: 2015-04-05
Posts: 2,095

Re: [Quick Question] Boolean thing

Offline

#3 2015-09-08 02:40:25

ParadoxInTheVoid
Member
From: ̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺
Joined: 2015-02-18
Posts: 341

Re: [Quick Question] Boolean thing

ninjasupeatsninja wrote:

Thanks. But not at all what I needed.


signature.png

Offline

#4 2015-09-08 02:55:53, last edited by SmittyW (2015-09-08 02:56:16)

SmittyW
Member
Joined: 2015-03-13
Posts: 2,085

Re: [Quick Question] Boolean thing

Are you referring to the ?: operator? If so, here's a link that might be useful: https://msdn.microsoft.com/en-us/library/ty67wk28.aspx

Basically, the condition or "if statement" is placed before the "?". If it is true, it will equal the first expression. Otherwise, it will result in the second expression:

var x = condition ? first_expression : second_expression;

Offline

Wooted by:

#5 2015-09-08 02:57:20

ParadoxInTheVoid
Member
From: ̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺̺
Joined: 2015-02-18
Posts: 341

Re: [Quick Question] Boolean thing

SmittyW. wrote:

Are you referring to the ?: operator? If so, here's a link that might be useful: https://msdn.microsoft.com/en-us/library/ty67wk28.aspx

Basically, the condition or "if statement" is placed before the "?". If it is true, it will equal the first expression. Otherwise, it will result in the second expression:

var x = condition ? first_expression : second_expression;

Yes, thank you. I couldn't find this.


signature.png

Offline

ParadoxInTheVoid1441677440539811

Board footer

Powered by FluxBB

[ Started around 1732460011.7064 - Generated in 0.029 seconds, 12 queries executed - Memory usage: 1.45 MiB (Peak: 1.58 MiB) ]