<p>One of the <a href="http://www.sqlite.org/whentouse.html" rel="noreferrer">appropriate uses</a> for <a href="http://www.sqlite.org" rel="noreferrer">sqlite3</a> is "in-memory databases".  This sounds like a really useful tool for my C++ applications.  Does anyone have an example of how this is done in C or C++?  I'm specifically looking for a canonical way to slurp several flat-files into an in-memory database, then do some joins.</p>

Just open the file :memory: and that should do it (at least it does in PHP).
You mention that you want to read in several flat files and do joins on them. If it's possible to store the flat files as SQLite databases, you can work directly with both by attaching one to the other:
```
```
ATTACH foo.db AS foo
```
```
Then refer to the tables in foo like so:
```
```
SELECT * FROM foo.users
```
```
This way you can do your joins without the need for creating an in-memory database.