iPhone - 将字符串转换为无符号字符
我正在尝试从服务器解密字符串。
我想要以下部分中的字符串 -
unsigned char Cipher1[] = {My String};
我的字符串是
“194,75,26,184,223,124,164,170,161,213,135,46,160,5,82,46,56,44,244,116,37,2 0,181,65,49,243,172,203,32,188,168,54,46,207,126,14,111,24,39,131,185,13,58,105, 32,168,77,83,202,165,242,198,34,192,161,39,202,58,230,72,234,218,171,50,187,235 ,124,24,16,2,117,188,221,73,136,37,81,217,30,17,57,136,91,224,178,12,37,255"
如何解决这个问题。
提前致谢。
I am trying to decrypt a string from the server.
And I want the string in following part -
unsigned char Cipher1[] = {My String};
My string is
"194,75,26,184,223,124,164,170,161,213,135,46,160,5,82,46,56,44,244,116,37,20,181,65,49,243,172,203,32,188,168,54,46,207,126,14,111,24,39,131,185,13,58,105,32,168,77,83,202,165,242,198,34,192,161,39,202,58,230,72,234,218,171,50,187,235,124,24,16,2,117,188,221,73,136,37,81,217,30,17,57,136,91,224,178,12,37,255"
How to solve this issue.
thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
试试这个:
Try this:
如果您只是想将 NSString 转换为 char *,请使用
- (const char *)cStringUsingEncoding:(NSStringEncoding)encoding
If you're simply looking to convert an NSString to a char *, use
- (const char *)cStringUsingEncoding:(NSStringEncoding)encoding