i have to convert unsigned char to char array. i m using ultoa() function that converts unsigned long char to a string. but it is giving me an error of Type Mismatch.
actualy i have tsend my data to server side where it is recieving in char array. so on client side data is stored in char array. but now i have to encrypt that data so encrypted data is unsigned char *
and i have to convert that unsigned char * to char array.... oherwise it is giving segmentation fault if i do not convert.
plzz plzzz helpp...
i m posting my code also.
//encrypt the message shorter than 8 bytes. strcpy((unsigned char *) input, plaintext); DES_ecb_encrypt(input, output, mysched, 1); ptr = (unsigned char *) output; for(j=0; j<8; j++) printf("%X", *(ptr+j)); printf("\n"); send_data=ultoa(ptr); // sendto fucntion used to send data to server sendto(sock,send_data, strlen(send_data), 0, (struct sockaddr *)&server_addr, sizeof(struct sockaddr));