OutputFile, err := os.OpenFile("output.txt", os.O_WRONLY, 0666) XXX: Skip error handling to save space XXX: "input.txt" and "output.txt" must already exist println variants are similar to the print variants except they put a newline at the end.Following arguments fill out its value in the format string in order. A format string is defined as the first argument. printf variants are identical to ones in C.print variants print each argument by its default format ( %v) with a space separating each value.scanln variants are similar to scan variants except they scan until finding a newline. The difference between Golang and C is that Golang treats a newline as a newline while C treats a newline as a space. They scan for values according to its format string.
0 Comments
Leave a Reply. |