Add and reverse IOS 16 binary

Source: Internet
Author: User

Convert nsstring string into char type in iOS

NSString *String = [NSString stringWithFormat:@ "5D"];         Const char *result = [string utf8string];

Char character turns into NSString

Char a["3er4";         *String = [NSString stringwithutf8string:a];

Converts a char type character to a decimal type, and then what type of input is required to convert directly

Long 0  - );        NSLog (@ "%lu", num);        NSLog (@ "%0lx", num);        NSLog (@ "%0lx", num);

%0x----is saved as 16 binary (lowercase letters)

%0x----is saved as 16 binary (Letters are uppercase)

Hex Add Inverse

UnsignedLongNUM1 = Strtoul ([@"5D"Utf8string],0, -); unsignedLongnum2 = Strtoul ([@"EE"Utf8string],0, -); unsignedLongnum3 = Strtoul ([@" A"Utf8string],0, -); unsignedLongNUM4 = Strtoul ([@" on"Utf8string],0, -); //binary additionByte A = num1 + num2 + num3 +num4;//Take counterByte B = ~A;//turn into hexNSString *string= [NSString stringWithFormat:@"%0x", B];

Add and reverse IOS 16 binary

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.