WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

Go Type casting


Type casting is a way to transform a variable from one facts kind to another information kind.

For example, in case you need to shop a long fee into a simple integer then you may kind solid lengthy to int. You can convert values from one type to another using the solid operator.
type_name(expression)

Example

Consider the following example where the forged operator causes the division of one integer variable by using some other to be finished as a floating wide variety operation.
package deal main

import "fmt"

func major() 
   var sum int = 20
   var count int = 25
   var imply float32
   
   mean = float32(sum)/float32(rely)
   fmt.Printf("Value of mean : %fn",imply)

Output

$move run foremost.Move
Value of suggest : 0.800000