You are viewing a single comment's thread. Return to all comments →
Scan functions of golang only scan word till space after space it wil send to next argument So you can use something like
var s string;
var t string;
fmt.Fscanln(os.Stdin, &s, &t);
fmt.Fprintln(os.Stdout, s, " ", t);
But it can not figure out how many arguments are there So to avoid this We can use scanner for this to read a whole line with spaces
Seems like cookies are disabled on this browser, please enable them to open this website
Day 0: Hello, World.
You are viewing a single comment's thread. Return to all comments →
Scan functions of golang only scan word till space after space it wil send to next argument So you can use something like
var s string;
var t string;
fmt.Fscanln(os.Stdin, &s, &t);
fmt.Fprintln(os.Stdout, s, " ", t);
But it can not figure out how many arguments are there So to avoid this We can use scanner for this to read a whole line with spaces