#include <iostream>
#include <fstream>
struct Example {
float x, y;
};
int main(void)
{
Example ex = { 3.14f, 17.25f };
std::ofstream ofs;
ofs.open("data.txt");
if ( !ofs ) {
std::cout << "error opening file";
exit(1);
}
ofs << ex.x << " " << ex.y;
ofs.close();
}
// data.txt
// --------
// 3.14 17.25
/*
run:
*/