I am studying Golang while translating C language into Golang.
No, I've been doing it for a long time, but I haven't made much progress in my research. I don't want to neglect to study programming in order to support various languages after getting a job.
However, Golang, personally, is hard to get along with C language.
This time as well, I will note that it fits firmly in the basics of the basics.
This is it.
<stdio.h>
printf("Hello, world!\n");
There are many because it is a latecomer language.
import "fmt"
fmt.Print("Hello, world!\n")
fmt.Printf("Hello, world!\n")
fmt.Println("Hello, world!\n")
Now the problem. Which one behaves the same as the C printf () function?
I'm not confident, but I felt the third was the closest in the test results.
See here for details.
It's easy to overlook both the standard C input (scanf ()) and the standard Golang input (fmt.Scanf ()).
** Separate strings with spaces. ** **
In the case of C language
fgets(buf, 30, stdin);
You can read strings from standard input including spaces, but Golang has some documents (this and [this](https:: //qiita.com/zurazurataicho/items/e66645bac16d9a482369) or this) It's quite difficult for beginners.
Meanwhile, I felt that this was good for beginners.
It's quite difficult ...
Currently, we are translating C language to Golang, so we plan to release it from the translated program.
Recommended Posts