このプログラムを 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]
助けてくれてありがとう。