Created
July 29, 2017 08:23
-
-
Save bam6o0/7c05b2c304d11e152536f106175cc64a to your computer and use it in GitHub Desktop.
This file contains 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() { | |
//int型で宣言 | |
var i int = 1234 | |
//int型からunit32型への変換 | |
var u uint32 = uint32(i) | |
//unit型からfloat型への変換 | |
var f float32 = float32(u) | |
//int型からstring型への変換 | |
var s string = string(i) | |
//string型からスライス型への変換 | |
var b []byte = []byte(s) | |
fmt.Println(u) | |
fmt.Println(f) | |
fmt.Println(s) | |
fmt.Println(b) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment