Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does ++1 mean

Tags:

vb.net

I just saw some sample code that someone posted (here) that set an integer variable equal to ++1. I was shocked that the VB.NET compiler would accept that as valid syntax. For instance, this compiles:

Dim i As Integer = 0
i = ++1
i = ++1
Console.WriteLine(i)  ' Outputs "1"

As best I can tell, it seems to ignore the pluses and just use the value that follows it. For instance:

Dim i As Integer = 0
i = ++10
Console.WriteLine(i)  ' Outputs "10"

So my question is, why is that valid syntax? Is there some rule for the + operator that I'm totally unaware of. As far as I knew, that was invalid and ++ was not, itself, an operator in VB.NET.

like image 920
Steven Doggart Avatar asked Mar 28 '14 17:03

Steven Doggart


People also ask

What does the number 1 symbolize?

New Beginnings The most common interpretation of 1 is that it represents a new beginning. Get ready for a new chapter in your life after encountering number one.

What does 1 mean in a text?

Definition: Active or Top Partner (typically used in gay dating) Type: Cyber Term.

What does the number 1 mean in love?

Encounter with number 1 means you're going to fall in love with somebody who will change your life forever. Be careful and try to recognize that person with an open heart. In case you already have a partner seeing number one means your bond will be stronger and love purer.

What does bring a +1 mean?

/ˌplʌs ˈwʌn/ a person that you take to a party or other event, usually when the invitation says that you can bring one other person with you: She asked Martin to be her plus one at the benefit. Inviting & summoning.

What does it mean to see repeating 1?

“Seeing repeating ones is an indicator that you're ready to respond and engage with the world. No need to wait—go share, teach, and pass on your knowledge. Trust your intuition,” Wilder says.


1 Answers

Unlike in some other languages, it’s just a sign. Signs can be duplicated – +-++1 works, ---3 works, and Not Not Not Not condition works as well.

like image 162
Konrad Rudolph Avatar answered Sep 27 '22 22:09

Konrad Rudolph