> For the complete documentation index, see [llms.txt](https://nodebook.js.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://nodebook.js.org/c-c++/c.md).

# CNotebook

"CNotebook" is used for `.c` files.

## Usage

### Setup

```javascript
const Nodebook = require('nodejs-notebook');

const index = new Nodebook.CNotebook('index');
```

**note(code)**

Similar to `addLine()` but it does not automatically add an indent.

string `code`:\
The C code to add.

```javascript
main.note('using namespace std;\nint main() {printf("hello world");\nreturn 0;\n}'
// Inserts this long line of code that should output "hello world"
```

**comment(comment)**

Insert a C Comment.

string `comment`:\
The comment message to add.

```javascript
main.comment('This needs editing, Franchis!');
// Inserts "/* Over here Michael! */"
```

**compile()**

Attempts to compile the C file.

```javascript
main.compile();
// Will output if there were any errors in the terminal.
```

**include(module)**

Inserts `#include <>` with the module name at the top.

```javascript
main.include('stdio.h');
// Inserts "#include <stdio.h>"
```
