我用 C 语言编写了这个程序,但出现了一个我不知道如何修复的错误。请帮我找出错误。这是我写的代码:
#include <stdio.h>
int main(int argc, char *argv[]){
int x = 98;
int *g = x;
printf("This is x: %d, and this is g: %i.\n", x, *g);
*g=45;
printf("This is x: %d, and this is g: %i.\n", x, *g);
return 0;
}
编译器给我以下错误:
ex15t.c: In function ‘main’:
ex15t.c:5:12: warning: initialization makes pointer from integer without a cast [enabled by default]
提前感谢您的帮助。