Well since this won't help you get any marks (if this is an assignment)
Code:
void print_string_as_hex(const char * s)
{
size_t len = strlen(s),
i = 0;
for(i = 0; i < len; i++)
{
printf("%X", s[i]);
}
return;
}
I didn't test it, hope it works :)
Read it and understand it before using it.
In my opinion you're jumping onto the 'code train' too early, design it first -- for example:
- open the dictionary file
- read each line (word), trim the newline character if nessisary -- adding the word to a linked list or array (sizing the array as nessisary with realloc() :))
- close the file
- do whatever with the array or linked list of words