When i run the code i got no output and program crash Anyone know how to correctly print out the char pointer ?
#include <stdio.h>
char *toUpperCase(char *str)
{
int i = 0;
while(str[i] != '\0')
{
str[i] = str[i] - 32;
i++;
}
return str;
}
int main()
{
printf("%s", toUpperCase("hello"));
return 0;
}