再牛逼的梦想也抵不住傻逼似的坚持!   设为首页 - 加入收藏
您的当前位置:小鱼资料库 > 计算机 > go教程 >

go教程

  • Go-二级指针-Go实例教程|

    Go - 二级指针 package main import fmt func main () { var a int var ptr * int var pptr ** int a = 3000 /* take the address of var */ ptr = a /* take the address of ptr using addr...

  • Go指针数组-Go实例教程|

    Go 指针数组 package main import fmt const MAX int = 3 func main () { a := [] int { 10 , 100 , 200 } var i int for i = 0 ; i MAX ; i ++ { fmt . Printf ( Value of a[%d] = %d , i ,...

  • Go空指针-Go实例教程|

    Go 空指针 package main import fmt func main () { var ptr * int fmt . Printf ( The value of ptr is : %x , ptr ) }...

  • Go指针-Go实例教程|

    Go 指针 package main import fmt func main () { var a int = 20 /* actual variable declaration */ var ip * int /* pointer variable declaration */ ip = a /* store address of a in poi...

  • Go传递数组给函数-Go实例教程|

    Go 传递数组给函数 package main import fmt func main () { /* an int array with 5 elements */ var balance = [] int { 1000 , 2 , 3 , 17 , 50 } var avg float32 /* pass array as a...

  • Go访问二维数组元素-Go实例教程|

    Go访问二维数组元素 package main import fmt func main () { /* an array with 5 rows and 2 columns*/ var a = [ 5 ][ 2 ] int { { 0 , 0 }, { 1 , 2 }, { 2 , 4 }, { 3 , 6 },{ 4 , 8...

  • Go访问数组元素-Go实例教程|

    Go 访问数组元素 package main import fmt func main () { var n [ 10 ] int /* n is an array of 10 integers */ var i , j int /* initialize elements of array n to 0 */ for i = 0 ; ...

  • Go字符串连接-Go实例教程|

    Go 字符串连接 package main import ( fmt math ) fmt strings ) func main () { greetings := [] string { Hello , world! } fmt . Println ( strings . Join ( greetings , )) }...

  • Go创建字符串-Go实例教程|

    ...

  • Go参数-Go实例教程|

    Go 参数 package main import fmt /* global variable declaration */ var a int = 20 ; func main () { /* local variable declaration in main function */ var a int = 10 var b int = 20 v...

  • Go变量作用域-Go实例教程|

    Go 变量作用域 package main import fmt /* global variable declaration */ var g int func main () { /* local variable declaration */ var a , b int /* actual initialization */ a = ...

  • Go作用域-Go实例教程|

    Go 作用域 package main import fmt func main () { /* local variable declaration */ var a , b , c int /* actual initialization */ a = 10 b = 20 c = a + b fmt . Printf ( value of a ...

  • Go方法-Go实例教程|

    Go 方法 package main import ( fmt math ) /* define a circle */ type Circle struct { x , y , radius float64 } /* define a method for circle */ func ( circle Circle ) area () float6...

  • Go函数闭包-Go实例教程|

    Go 函数闭包 package main import fmt func getSequence () func () int { i := 0 return func () int { i += 1 return i } } func main (){ /* nextNumber is now a function with i as 0 *...

  • Go函数值-Go实例教程|

    Go 函数值 package main import ( fmt math ) func main (){ /* declare a function variable */ getSquareRoot := func ( x float64 ) float64 { return math . Sqrt ( x ) } /* use the fun...

  • Go引用传递-Go实例教程|

    Go 引用传递 package main import fmt func main () { /* local variable definition */ var a int = 100 var b int = 200 fmt . Printf ( Before swap, value of a : %d , a ) fmt . Printf...

  • Go值传递-Go实例教程|

    Go 值传递 package main import fmt func main () { /* local variable definition */ var a int = 100 var b int = 200 fmt . Printf ( Before swap, value of a : %d , a ) fmt . Printf ( ...

  • Go调用函数-Go实例教程|

    Go 调用函数 package main import fmt func main () { /* local variable definition */ var a int = 100 var b int = 200 var ret int /* calling a function to get max value */ ret = ma...

  • goto语句-Go实例教程|

    goto 语句 package main import fmt func main () { /* local variable definition */ var a int = 10 /* do loop execution */ LOOP : for a 20 { if a == 15 { /* skip the iteration */ a =...

  • Gocontinue语句-Go实例教程|

    Go continue 语句 package main import fmt func main () { /* local variable definition */ var a int = 10 /* do loop execution */ for a 20 { if a == 15 { /* skip the iteration */ a =...

小鱼资料库 www.xiaoyuzl.com

Copyright © 2020-2022 XIAOYUZL. All rights reserved. 冀ICP备2020029262号-2

声明:本站分享的文章、资源等均由网友上传,版权归原作者所有,只用于搜集整理。如有侵权,请您与站长联系,我们将及时处理!

Top