representation of MAC address in C code

与世无争的帅哥 提交于 2019-12-19 06:39:05

问题


I often see such representation of MAC address in C code:

struct mac_addr {
   unsigned char bytes[6];
}

Why necessary put an array in a structure, why not just have an array? What benefit does this provide?

Thanks.


回答1:


You can't assign an array in C. But you can assign a struct.



来源:https://stackoverflow.com/questions/19482750/representation-of-mac-address-in-c-code

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!