As already noted, a simple cast is enough.
Please note
aa
should be declared
const char *
.
#include <stdio.h>
int main()
{
const char * aa = "test";
const unsigned char * bb = (const unsigned char *) aa;
while ( *bb )
printf("%02X ", *bb++);
printf("\n");
return 0;
}