小编use*_*end的帖子

使用指针编译C程序时出错

当我在我的计算机上运行它时,我得到编译错误.但是,我确实从我在互联网上找到的教程中直接复制了它.

#include <stdio.h>
#include <conio.h>

void main(){
    int i = 9;
    clrscr();

    printf("The value of i is: %d\n", i);
    printf("The address of i is: %u\n", &i);
    printf("The value at the address of i is: %d\n", *(&i));

    getch();
}
Run Code Online (Sandbox Code Playgroud)

错误:

$ cc "-Wall" -g    ptrex6.c   -o ptrex6
ptrex6.c:7:19: error: conio.h: No such file or directory
ptrex6.c:9: warning: return type of ‘main’ is not ‘int’
ptrex6.c: In function ‘main’:
ptrex6.c:11: warning: implicit declaration of function ‘clrscr’
ptrex6.c:14: warning: format ‘%u’ expects type …
Run Code Online (Sandbox Code Playgroud)

c pointers

0
推荐指数
1
解决办法
2668
查看次数

标签 统计

c ×1

pointers ×1