Convert char* to WORD*

This is a discussion on Convert char* to WORD* within the C Programming forums, part of the General Programming Boards category; I need to convert a char* to a unsigned int* for input into an RC5 encryption algorhythm method. The program ...

Convert char* to WORD*

I need to convert a char* to a unsigned int* for input into an RC5 encryption algorhythm method. The program ends up crashing when trying to use the converted type. How can this conversion be made properly?

Well you certainly can't just cast two data types that are of different sizes and expect something to magically make sense of it. What I suspect you want to do is convert each character in your char array to it's corresponding integer ASCII code value, and put all of these values in an unsigned array.