Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

go read file to string

// go read file to string
b, err := ioutil.ReadFile("file.txt") // just pass the file name
    if err != nil {
        fmt.Print(err)
    }
str := string(b) // convert content to a 'string'
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #read #file #string
ADD COMMENT
Topic
Name
3+3 =