Created
June 15, 2019 07:54
-
-
Save gophersumit/25f2a8ece4c46b7d0ae83891ca76bb6b to your computer and use it in GitHub Desktop.
Increment operator in go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import "fmt" | |
| func main() { | |
| x := 0 | |
| x++ //valid operation | |
| fmt.Println(x++) // invalid operation x++ is not an expression | |
| ++x // invalid operation , prefix increment does not exist in go | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment