zoukankan      html  css  js  c++  java
  • include用尖括号还是双引号,C++

    http://stackoverflow.com/questions/21593/what-is-the-difference-between-include-filename-and-include-filename

    The sequence of characters between < and > uniquely refer to a header, which isn't necessarily a file. Implementations are pretty much free to use the character sequence as they wish. (Mostly, however, just treat it as a file name and do a search in the include path, as the other posts state.)

    If the #include "file" form is used, the implementation first looks for a file of the given name, if supported. If not (supported), or if the search fails, the implementation behaves as though the other (#include <file>) form was used.

    Also, a third form exists and is used when the #include directive doesn't match either of the forms above. In this form, some basic preprocessing (such as macro expansion) is done on the "operands" of the #include directive, and the result is expected to match one of the two other forms.

    --

    The simple general rule is to Use angled brackets to include header files that come with the compiler. Use double quotes to include any other header files.

    简单地说,系统头文件用尖括号,比如#include <iostream>,尖括号里面的不一定是个文件名

    其他的(自己写的头文件,下载的包等)用双引号

  • 相关阅读:
    T-SQL查询语句
    数据库和表的管理
    数据库概念
    IRF2实验
    IFR2笔记
    校园网双网出口实验案例
    双机热备实验
    华为H3C(NAT)实验
    BGP(边界网关协议)实验
    Hybrid实验
  • 原文地址:https://www.cnblogs.com/fstang/p/3127143.html
Copyright © 2011-2022 走看看