I have a wireshark data whose output looks like this say: "c1 c1 31 ad 1f...". I have stored these values is an array
unit8_t array[10]={0xc1,0xc1,0x31,0xad,0x1f...} Now I want to convert this array in little endian and store in some other array:
//Sample code to convert to little endian for(i = 0;i<32;i++) { uint8_t res = ntohs(htons(array[i]));// converting element to little endian plain_text_little_endian[i] = res; } Just wanted to know, will it convert the value "res" in little endian?