参考:https://learnxinyminutes.com/docs/yaml/
key-value
key: value
another_key: Another value goes here.
a_number_value: 100
scientific_notation: 1e+12
hex_notation: 0x123 # evaluates to 291
octal_notation: 0123 # evaluates to 83
小于 1 分钟
参考:https://learnxinyminutes.com/docs/yaml/
key: value
another_key: Another value goes here.
a_number_value: 100
scientific_notation: 1e+12
hex_notation: 0x123 # evaluates to 291
octal_notation: 0123 # evaluates to 83
定义命名空间(namespace):
#include <iostream>
namespace foo // define a namespace named foo
{
// This doSomething() belongs to namespace foo
int doSomething(int x, int y)
{
return x + y;
}
}
namespace goo // define a namespace named goo
{
// This doSomething() belongs to namespace goo
int doSomething(int x, int y)
{
return x - y;
}
}
int main()
{
std::cout << foo::doSomething(4, 3) << '\n'; // use the doSomething() that exists in namespace foo
return 0;
}