Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the latest interview questions in Go language in 2022?

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces the relevant knowledge of the latest interview questions of 2022 Go language, the content is detailed and easy to understand, the operation is simple and fast, and has a certain reference value. I believe you will gain something after reading this latest interview question of 2022 Go language. Let's take a look at it.

1. What happens when compiling and executing the following code?

Package mainvar (size: = 1024 max_size = size*2) func main () {println (size,max_size)}

Parsing test point: variable short pattern variable short pattern restriction:-define variable and explicitly initialize-cannot provide data type-can only be used within the function

Results:

Syntax error: unexpected: =

2. What's wrong with the following function?

Package mainconst cl = 100var bl = 123func main () {println (& bl,bl) println (& cl,cl)}

Parsing points: constant constants are different from variables in allocating memory at run time. Constants are usually expanded directly by the compiler during the preprocessing stage and used as instruction data.

Cannot take the address of cl

3. What happens when compiling and executing the following code?

Package mainfunc main () {for iVOB0TIVI

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report