This is certainly wrong:
The first argument to strcat must be a pointer to a character in an array of char that can be modified. Modifying a string literal results in undefined behaviour.
strcat ("0x", str);
Note that you will be overwriting str on each iteration of the for loop.
Furthermore, I suspect that you don't want to use strcat in this way, since you print testData1[y] and testData1[s] as chars, and y and s are consecutive. If so, you probaby want to write:
Thus you do away with y and s.
strncat(str, testData + i, 2);
str = '\0';
Next, what are you trying to do in these two lines?
*(hex + t) = "0x" + *str;
int t = t+1;