The function Emitter::c_str()returns the string NULL-terminated C-style (which you should not let go), which you can then write to the file. For instance:
YAML::Emitter emitter;
emitter << "Hello world!";
std::ofstream fout("file.yaml");
fout << emitter.c_str();
Emitter::size(), , - , , .
Node , :
YAML::Node node = ...;
std::ofstream fout("file.yaml");
fout << node;