标签: iphone objective-c int unsigned
我想从plist中获取一个整数并将其与sin_port一起使用。但是sin_port需要unsigned short而不是int如何将int转换为unsigned short int?
sin_port
unsigned short
int
unsigned short int
答案 0 :(得分:7)
我不知道objective-c但是在简单的C中你可以做类似
int value = 1234; unsigned short sin_port = (unsigned short) value;