fmt.Sscan() Function in Golang With Examples Last Updated : 05 May, 2020 Comments Improve Suggest changes Like Article Like Report In Go language, fmt package implements formatted I/O with functions analogous to C's printf() and scanf() function. The fmt.Sscan() function in Go language scans the specified texts and store the successive space-separated texts into successive arguments. Moreover, this function is defined under the fmt package. Here, you need to import the "fmt" package in order to use these functions. Syntax: func Sscan(str string, a ...interface{}) (n int, err error) Parameters: This function accepts two parameters which are illustrated below: str string: This parameter contains the specified text which is going to be scanned. a ...interface{}: This parameter receives each texts. Returns: It returns the number of items successfully scanned. Example 1: C // Golang program to illustrate the usage of // fmt.Sscan() function // Including the main package package main // Importing fmt import ( "fmt" ) // Calling main func main() { // Declaring two variables var name string var alphabet_count int // Calling the Sscan() function which // returns the number of elements // successfully scanned and error if // it persists n, err := fmt.Sscan("GFG 3", &name, &alphabet_count) // Below statements get executed if there is any error if err != nil { panic(err) } // Printing the number of elements and each elements also fmt.Printf("%d: %s, %d\n", n, name, alphabet_count) } Output: 2: GFG, 3 Example 2: C // Golang program to illustrate the usage of // fmt.Sscan() function // Including the main package package main // Importing fmt import ( "fmt" ) // Calling main func main() { // Declaring some variables var name string var alphabet_count int var float_value float32 var boolean_value bool // Calling the Sscan() function which // returns the number of elements // successfully scanned and error if // it persists n, err := fmt.Sscan("GeeksforGeeks 13 6.7 true", &name, &alphabet_count, &float_value, &boolean_value) // Below statements get // executed if there is any error if err != nil { panic(err) } // Printing the number of // elements and each elements also fmt.Printf("%d: %s, %d, %g, %t", n, name, alphabet_count, float_value, boolean_value) } Output: 4: GeeksforGeeks, 13, 6.7, true Comment More infoAdvertise with us Next Article fmt.Sscan() Function in Golang With Examples K Kanchan_Ray Follow Improve Article Tags : Go Language Golang-fmt Similar Reads fmt.Sscanf() Function in Golang With Examples In Go language, fmt package implements formatted I/O with functions analogous to C's printf() and scanf() function. The fmt.Sscanf() function in Go language scans the specified string and stores the successive space-separated values into successive arguments as determined by the format. Moreover, th 2 min read fmt.Scan() Function in Golang With Examples In Go language, fmt package implements formatted I/O with functions analogous to C's printf() and scanf() function. The fmt.Scan() function in Go language scans the input texts which is given in the standard input, reads from there and stores the successive space-separated values into successive arg 2 min read fmt.Sscanln() Function in Golang With Examples In Go language, fmt package implements formatted I/O with functions analogous to C's printf() and scanf() function. The fmt.Sscanln() function in Go language scans the specified string and stores the successive space-separated values into successive arguments. This function stops scanning at a newli 2 min read fmt.Scanf() Function in Golang With Examples In Go language, fmt package implements formatted I/O with functions analogous to C's printf() and scanf() function. The fmt.Scanf() function in Go language scans the input texts which is given in the standard input, reads from there and stores the successive space-separated values into successive ar 2 min read fmt.Scanln() Function in Golang With Examples In Go language, fmt package implements formatted I/O with functions analogous to C's printf() and scanf() function. The fmt.Scanln() function in Go language scans the input texts which is given in the standard input, reads from there and stores the successive space-separated values into successive a 2 min read fmt.Sprint() Function in Golang With Examples In Go language, fmt package implements formatted I/O with functions analogous to C's printf() and scanf() function. The fmt.Sprint() function in Go language formats using the default formats for its operands and returns the resulting string. Here spaces are added between operands when any string is 3 min read fmt.Sprintf() Function in Golang With Examples In Go language, fmt package implements formatted I/O with functions analogous to C's printf() and scanf() function. The fmt.Sprintf() function in Go language formats according to a format specifier and returns the resulting string. Moreover, this function is defined under the fmt package. Here, you 2 min read fmt.Sprintln() Function in Golang With Examples In Go language, fmt package implements formatted I/O with functions analogous to C's printf() and scanf() function. The fmt.Sprintln() function in Go language formats using the default formats for its operands and returns the resulting string. Here spaces are always added between operands and a newl 2 min read fmt.print() Function in Golang With Examples In Go language, fmt package implements formatted I/O with functions analogous to C's printf() and scanf() function. The fmt.print() function in Go language formats using the default formats for its operands and writes to standard output. Here Spaces are added between operands when any string is not 2 min read fmt.Printf() Function in Golang With Examples In Go language, fmt package implements formatted I/O with functions analogous to C's printf() and scanf() function. The fmt.Printf() function in Go language formats according to a format specifier and writes to standard output. Moreover, this function is defined under the fmt package. Here, you need 3 min read Like