The difference between typedef Define static extern
1) #define #definepi 3.1415926
In the program: Pi*r*r is replaced with the number in the # define statement 9 g
2) A typedef is processed at compile time. It gives an alias to an already existing type within its scope, but you cannot use the typedef specifier inside a function definition.
extern can be placed before a variable or function to represent the definition of a variable or function in another file, prompting the compiler to find its definition in other modules when it encounters this variable or function. In addition, extern can also be used to specify links.
Static as a keyword and function appears in other advanced computer languages such as Fortran, ALGOL, COBOL, BASIC, LISP, Snobol, PL/1, Pascal, PROLOG, Ada and other languages have appeared, but have different roles.
The difference is:
1, global variables are not explicitly used static modified global variables, the global variable by default is externally linked, scope is the entire project, in one file defined global variables, in another file, through the extern global variable name declaration, you can use global variables;
2. A global static variable is a global variable that is explicitly modified with static, scoped to the file where the variable is declared, and the other file is not used with the extern declaration.
The difference between typedef Define static extern