For strings, you'll probably need to print each character one at a time. Generally, when I print hex characters, I also like to print a 0 in front of hex values less than 10, so like 0F instead of F... The following code should do that for you
using namespace std;
cout << hex << setfill('0') << setw(2) <<
static_cast<int>(input[c]) << " ";
P.S. Sorry if I came across too strong in my previous post. I didn't mean it to come across as insulting in any way.
Also, segmentation faults usually occur when you are touching memory in some way that you have no right to be touching it. (Shame on you! That's a bad touch!) That includes things like dereferencing dangling pointers, going beyond the bounds of an array, trying to change memory that is flagged as "constant," etc.