Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要将字符数组数据复制到字节数组中。例如 :
char buffer[20] = "00020406080A0C0E1012"; byte data[10];
那么,如何将字符数组数据复制到字节数组中..
请给出解决方案。谢谢
使用 for 循环:
for (i=0;i<elCount(buffer);i++) { data[i] = buffer[i]; }
转换应该是自动的。
客户端(蟒蛇):
theta = math.sin(23/3) / 300 y = math.cos(23/11) / 20 data=struct.pack('<ff',theta,y) # pack with two float s.sendto(data, (ip, 50000))
服