我有一个问题,警告c4133,它说问题是从char*到int*的无法使用的类型,我尝试施放指针((char*)x)但没有运气,也许有人知道什么是问题/
这是我的程序,功能中的问题.
void replaceSubstring(char *str, char *substr)//function that gets string and substring and make the substring in string big letters
{
int i;
int *x;
x = (strstr(str, substr));//The problem line
while (strstr(str,substr) != NULL)
{
for (i=0;i<strlen(substr);i++)
{
*x = *x - 32;
x++;//move to the next char
}
x = (strstr(str, substr)); //first apear of substr int str
}
}
Run Code Online (Sandbox Code Playgroud)