如何将int转换为无符号短int-iPhone
我试图从plist中获取一个整数,并将其与如何将int转换为无符号短int-iPhone,iphone,objective-c,int,unsigned,Iphone,Objective C,Int,Unsigned,我试图从plist中获取一个整数,并将其与sin\u port一起使用。但是,sin_port需要无符号短整数而不是int如何将int转换为无符号短整数 我不知道objective-c,但在普通c中,您可以执行以下操作 int value = 1234; unsigned short sin_port = (unsigned short) value;
sin\u port
一起使用。但是,sin_port
需要无符号短整数
而不是int
如何将int
转换为无符号短整数
我不知道objective-c,但在普通c中,您可以执行以下操作
int value = 1234;
unsigned short sin_port = (unsigned short) value;