如何为固定大小的char数组创建类型别名? [英] How do I create a type alias for an array of char with a fixed size?

查看:64
本文介绍了如何为固定大小的char数组创建类型别名?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道如何创建类型,以便:

I can't figure out how to create a type so that:

type CountryCode = &[char] // only 3 chars in it, no more

是否可以使用 type 来做到这一点,还是应该使用 struct 代替?

Is it possible to do that with type, or should I use struct instead?

推荐答案

扩展

这篇关于如何为固定大小的char数组创建类型别名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆