I have a short variable and i want to convert it to 2 bytes in iOS
short num = 10;
char *bytes;
Now I want to convert this num value into bytes
Please help me
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
May be like this
char * bytes = malloc(sizeof(char) * 2);
EDIT : After all the comments below..
Now you can understand the difference..