tmp/tmpa4jv0pwl/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
### General <a id="support.c.headers.general">[[support.c.headers.general]]</a>
|
| 2 |
+
|
| 3 |
+
For compatibility with the C standard library, the C++ standard library
|
| 4 |
+
provides the *C headers* shown in [[c.headers]]. The intended use of
|
| 5 |
+
these headers is for interoperability only. It is possible that C++
|
| 6 |
+
source files need to include one of these headers in order to be valid
|
| 7 |
+
ISO C. Source files that are not intended to also be valid ISO C should
|
| 8 |
+
not use any of the C headers.
|
| 9 |
+
|
| 10 |
+
[*Note 1*: The C headers either have no effect, such as `<stdbool.h>`
|
| 11 |
+
and `<stdalign.h>`, or otherwise the corresponding header of the form
|
| 12 |
+
`<cname>` provides the same facilities and assuredly defines them in
|
| 13 |
+
namespace `std`. — *end note*]
|
| 14 |
+
|
| 15 |
+
[*Example 1*:
|
| 16 |
+
|
| 17 |
+
The following source file is both valid C++ and valid ISO C. Viewed as
|
| 18 |
+
C++, it declares a function with C language linkage; viewed as C it
|
| 19 |
+
simply declares a function (and provides a prototype).
|
| 20 |
+
|
| 21 |
+
``` cpp
|
| 22 |
+
#include <stdbool.h> // for bool in C, no effect in C++{}
|
| 23 |
+
#include <stddef.h> // for size_t
|
| 24 |
+
|
| 25 |
+
#ifdef __cplusplus // see [cpp.predefined]
|
| 26 |
+
extern "C" // see [dcl.link]
|
| 27 |
+
#endif
|
| 28 |
+
void f(bool b[], size_t n);
|
| 29 |
+
```
|
| 30 |
+
|
| 31 |
+
— *end example*]
|
| 32 |
+
|