# 外部变量

目录下新建 `extern.h` 文件，代码如下。

```c
extern int i = 233;
```

执行下面的代码，即可访问外部变量。

```c
#include <stdio.h>
#include "extern.h"

int main(int argc, char const *argv[])
{
    printf("%d\n", i);
    return 0;
}
```
