S
S
Stas Vinokur2019-02-02 14:10:50
go
Stas Vinokur, 2019-02-02 14:10:50

How to check a string with text in Golang?

When I try to write to line D5 it just writes 0

package main

import (
  "fmt"
  "os"
)
   func main() {
   	var pos int
    //var postest int
    fmt.Println("Введите шахматную позицию от поля D5 (Конь)")
   	fmt.Fscan(os.Stdin, &pos)
   	fmt.Println("Вы ввели позицию :" , pos)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Pavlyuk, 2019-02-02
@pav5000

The variable pos is of type int, how are you going to write D5 to it?
Make a string for example.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question