我不知道该怎么做
#include "fstream"
#include "iostream"
using namespace std;
#define out(a) cout << #a << ": " << a << '\n'
void print(string s)
{
cout << s << '\n';
}
int main()
{
ifstream readt1;
readt1.open("test1.yaml");
while(readt1.good())
{
char cc[128];
readt1.get(cc,128);
out(cc);
}
readt1.close();
}
该代码...输出:
cc: version: 0.14.1
cc:
test.yaml 就是这个
version: 0.14.1
name: scrumbleship
author: dirkson
description: >
A minecraft like game that allows you
to build your own spaceship!
我已经尝试了很多方法来让它工作,但它根本没有