Is the backslash acceptable in C and C++ #include directives?

后端 未结 6 1368
有刺的猬
有刺的猬 2020-11-27 17:22

There are two path separators in common use: the Unix forward-slash and the DOS backslash. Rest in peace, Classic Mac colon. If used in an #include dir

6条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-27 17:59

    The standard says for #include that it:

    searches a sequence of implementation-defined places for a header identified uniquely by the specified sequence between the delimiters, and causes the replacement of that directive by the entire contents of the header. How the places are specified or the header identified is implementation-defined.

    Note the last sentence.

提交回复
热议问题