#include <stdio.h>
int main(void) {
int *pVar, var = 10;
pVar = &var;
//*pVar = var;
printf("value = %d, address = Ox%X\n", var, &var);
// Format specifies type 'unsigned int' but the argument has type 'int *'
printf("pValue = %d, address = Ox%X\n", *pVar, pVar);
// Format specifies type 'unsigned int' but the argument has type 'int *'
*pVar = 20;
printf("value = %d, address = Ox%X\n", var, &var);
// Format specifies type 'unsigned int' but the argument has type 'int *'
printf("pValue = %d, address = Ox%X\n", *pVar, pVar);
// Format specifies type 'unsigned int' but the argument has type 'int *'
return 0;
}
我找到了一些警告如何以c语言删除格式警告?
格式指定型unsigned int
但参数的类型为int *
即使程序运行,因为我打算,我想知道为什么发生这种情况。
我应该怎么做才能删除这些错误而不会在结果中出现错误?
请上传文本格式的代码在这里。 –
@SouravGhosh'UB'是什么意思? – Kotshi
@Kotshi未定义的行为。 –