package main import "fmt" const ( i = 7 j k ) func main() { fmt.Println(i,j,k) }
这段代码的输出为什么是 777 呢???
constant declarations
Within a parenthesized const declaration list the expression list may be omitted from any but the first ConstSpec. Such an empty list is equivalent to the textual substitution of the first preceding non-empty expression list and its type if any. Omitting the list of expressions is therefore equivalent to repeating the previous list. The number of identifiers must be equal to the number of expressions in the previous list. ......
const
2.1m questions
2.1m answers
62 comments
56.6k users