mirror of
https://github.com/ToruNiina/toml11.git
synced 2025-09-16 16:28:09 +08:00
🐞 fix(README.md): fix syntax errors
This commit is contained in:
13
README.md
13
README.md
@@ -23,15 +23,16 @@ toml11 is a feature-rich TOML language library for C++11/14/17/20.
|
|||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
|
```toml
|
||||||
|
# example.toml
|
||||||
|
title = "an example toml file"
|
||||||
|
nums = [3, 1, 4, 1, 5] # pi!
|
||||||
|
```
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
#include <toml.hpp>
|
#include <toml.hpp>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
// ```toml
|
|
||||||
// title = "an example toml file"
|
|
||||||
// nums = [3, 1, 4, 1, 5] # pi!
|
|
||||||
// ```
|
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
// select TOML version at runtime (optional)
|
// select TOML version at runtime (optional)
|
||||||
@@ -50,7 +51,7 @@ int main()
|
|||||||
}
|
}
|
||||||
if(data.at("nums").is_array())
|
if(data.at("nums").is_array())
|
||||||
{
|
{
|
||||||
data.push_back(9);
|
data["nums"].as_array().push_back(9);
|
||||||
}
|
}
|
||||||
|
|
||||||
// check comments
|
// check comments
|
||||||
|
Reference in New Issue
Block a user