Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
Someone
on Oct 15, 2024
|
parent
|
context
|
favorite
| on:
The C23 edition of Modern C
> C++ code can seamlessly add #include "sqlite3.h" unchanged.
Almost seamlessly. You have to do
extern “C” { #include "sqlite3.h" }
(
https://isocpp.org/wiki/faq/mixing-c-and-cpp#include-c-hdrs-...
)
cornstalks
on Oct 15, 2024
[–]
If we're nitpicking then sqlite3.h already has `#ifdef __cplusplus` and `extern "C" {`. So yes, from the user's perspective it is seamless. They do not need to play the `extern "C" {` game.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search:
Almost seamlessly. You have to do
(https://isocpp.org/wiki/faq/mixing-c-and-cpp#include-c-hdrs-...)