ContributePerguntasPublicaçõesTags
VIKEnut'
EntrarInscreva-se

Pt

РусскийDeutschEspañol

Tema escuro

Write
EntrarInscreva-se

Tema escuro

Pt

РусскийDeutschEspañol

Você é muito ativo! É ótimo!

Registre-se para continuar usando todos os recursos do Techfeed

SignUpAction

Já possui uma conta?SignInAction

Tags populares

parsinglistdriverblueimpkernelconsole-applicationfile-uploadremote-servercommandsshspringunixbigintegerrenderingspring-securityrandomruby-on-rails-3keystrokeshortcutwindows-mobile-6.5

Perguntas relacionadas

1

Convertendo array de strings C em Swift array de strings

4

Como converter um bool para uma string no Go?

25

Como analiso uma string em um float ou int em Python?

5

Não é possível converter implicitamente o tipo 'customtype' para 'othercustomtype'

5

Por que usar conversões implícitas / explícitas em vez de construtores?

Jan 20, 2015, 02:48 PM
 
type-conversiongoarrays

Converter matriz de tamanho fixo em matriz de tamanho variável no Go

Estou tentando converter uma matriz de tamanho fixo[32]byte para matriz de tamanho variável (fatia)[]byte:

package main

import (
        "fmt"
)

func main() {
        var a [32]byte
        b := []byte(a)
        fmt.Println(" %x", b)
}

mas o compilador lança o erro:

./test.go:9: cannot convert a (type [32]byte) to type []byte

Como devo convertê-lo?

questionAnswers(2)

yourAnswerToTheQuestion

Perguntas populares

0 a resposta

Criar XSD a partir de XML no código

0 a resposta

Como reutilizar menus no aplicativo RCP para o Eclipse 4.2?

0 a resposta

O thread shared_ptr <XXX> é seguro?

0 a resposta

Deseja formatar o NSDate em janeiro, 2000 ou janeiro de 2000

0 a resposta

Como excluir um evento específico no calendário

© 2020. Todos os direitos reservados
Feito com amor 

Pt

РусскийDeutschEspañol