Char before ascii - Objective-C

I want to convert char array to ascii,

I started trying with NSString, characterAtIndex (due to lack of knowledge on unichar management)

creating a char array and passing it to NSString using stringWithCString (failed due to lack of coding knowledge)

now in the end I convince myself using a regular char array and type it into an int.

but my mind says this is not a good practice.

Please tell me if there is another solution like Objective-C, or is this the only solution.

I am new and working on GNUStep.

0
source share
2 answers

NSString Unicode. C- , -[NSString cStringUsingEncoding:], const char *. , . ASCII NSASCIIStringEncoding:

const char *asciiCString = [myString cStringWithEncoding:NSASCIIStringEncoding];
+2

char -array, , , C-, ASCII, NSString, , .

NSString, NSString, char *...

0

Source: https://habr.com/ru/post/1779848/


All Articles