char str1[20] = "Something";
char *str2 = "Random";
strcat(str1, str2[1]);
It gives the error pointer from integer without a cast
why is str2[1] treated as an integer?
so what should I do if I want to strcat individual elements in a string
Thanks!
Because an element from a
chararray is achar, which is an integral type. If you want a pointer to the second element, trystr2 + 1or&str2[1].