Get the App
SLTechnology News&Howtos  ›  Development  › 

What does extern mean in C language?

Shulou Source: shulou.com Published: 2022-06-02 22:53:55 10月03日 Update

This article mainly explains "what is the meaning of extern in c language". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "what is the meaning of extern in c language"?

1. If a variable uses the keyword extern and the variable is declared as an external variable, it means that the variable is a defined external variable. With this declaration, you can start with the declaration and legally use external variables.

2. Extern modifies variable declaration and function declaration.

Example

/ * file1.c * / int x = 10 printf func1 (); / * file2.c * / extern int x; / / this variable is already defined externally, here there is only a declaration extern int func1 (); / / the function is already externally defined, here only a declaration int main (void) {printf ("x =% d", x); / / x = 10 int (); return 0 } at this point, I believe you have a deeper understanding of "what is the meaning of extern in c language". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Tags: Variables meaning language content functions learning legal practical deeper key keywords interests examples practicality practicality simple operation methods more friends websites Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info Linux Shulou Technology Redmi Shulou Information