zoukankan      html  css  js  c++  java
  • extern

    extern

    extern关键字

    extern declarator      // used when variable or function has external linkage
    extern 声明               //   当变量或函数有外部的联接时使用

    extern
    string-literal declarator      // used when linkage conventions of another
                              // language are being used for the declarator
    extern string类型 声明            //   当其他语言的联接约定被用来作为声明符时使用

    extern string-literal { declarator-list }   // used when linkage conventions of another
                             // language are being used for the declarators
    extern string类型{声明符列表} 声明            //   当其他语言的联接约定被用来作为声明符时使用


    The extern keyword declares a variable or function and specifies that it has external linkage (its name is visible from files other than the one in which it's defined). When modifying a variable, extern specifies that the variable has static duration (it is allocated when the program begins and deallocated when the program ends). The variable or function may be defined in another source file, or later in the same file. In C++, when used with a string, extern specifies that the linkage conventions of another language are being used for the declarator(s).
    extern 关键字声明一个变量或者函数,它包含外部联接(它的名字对文件来说是可见的,不同于在定义时不可见)。
    当更改一个变量时,extern 指定变量为 静态生命期(也就是说当程序运行时分配,程序结束时被收回)。
    变量或者函数可能被定义在另外一个源文件中,或者在同一个文件的后面部分。在C++中,当使用一个string(字符串)时,extern 指定其他语言的联接约定被用来作为声明符时使用


    Declarations of variables and functions at file scope are external by default.
    默认情况下,在文件域中声明变量和函数是外部的。

    In C++, string-literal is the name of a language. The language specifier "C++" is the default. "C" is the only other language specifier currently supported by Microsoft C/C++. This allows you to use functions or variables defined in a C module.
    在C++中,string串 是一个关键字。


    All of the standard include files use the extern "C" syntax to allow the run-time library functions to be used in C++ programs.

    For more information, see auto, register, static, const, and volatile.

    Example

    The following example declares the functions printf, getchar, and putchar with “C” linkage:

    // Example of the extern keyword
    extern "C" int printf( const char *, ... );
    
    extern "C"
    {
       int getchar( void );
       int putchar( int );
    }
  • 相关阅读:
    easyui的dataGrid生成的日期时间,总是不能很好的兼容ie8和谷歌,终于摸索出一个合适的办法
    DELPHI使用TClientDataSet时不携带MIDAS.DLL的方法
    你又重新年轻了一次,这一次你打算怎么活?
    c#网站项目的发布:项目方式、webSite网站模式(未能获得项目引用XXX的依赖项的解决)
    当取不到raisError的错误信息只能取到return的错误代码时,可以取connection.errors[0].description
    layer iframe大致使用
    全选
    下拉选
    checkbox
    js判断值对否为空
  • 原文地址:https://www.cnblogs.com/ctoroad/p/394263.html
Copyright © 2011-2022 走看看