I want to get the ascii value of characters in a string in c

If my string has the value 9quali52ty3 i want an array with the ascii values of each of the 11 characters

Where can i get ascii values in c?

Best Answer


From MSDN

string value = "9quali52ty3";

// Convert the string into a byte[].
byte[] asciiBytes = Encoding.ASCII.GetBytes(value);

You now have an array with the ascii value of the bytes I've got the following

57 113 117 97 108 105 53 50 116 121 51