Write
#include <iostream>
#include <fstream>
int main()
{
    std::string name = "George Washington";
    std::string phone = "703-780-2000";
    std::string dimensions = "100 50 3";
    std::string color = "Black";
    std::ofstream file("data.txt");
    file << name + "\n";
    file << phone + "\n";
    file << dimensions + "\n";
    file << color;
    file.close();
}
Read
#include <iostream>
#include <fstream>
int main()
{
    std::string name;
    std::string phone;
    std::string dimensions;
    std::string color;
    std::ifstream file("data.txt");
    std::getline(file, name);
    std::getline(file, phone);
    std::getline(file, dimensions);
    std::getline(file, color);
    std::cout << "name: " << name << "\nphone: " << phone
    << "\ndimensions: " << dimensions << "\ncolor: " << color << "\n";
    file.close();
}
Output
name: George Washington
phone: 703-780-2000
dimensions: 100 50 3
color: Black
Update
Write Structures
#include <iostream>
#include <fstream>
typedef struct{
    std::string name;
    std::string phone;
    std::string dimensions;
    std::string color;
}Customer;
int main()
{
    Customer customer[2]; // number of customers
    puts("Max number of customers is 2");
    for(int id = 0; id < 2; ++id)
    {
        std::cout << id <<"| name: ";
        std::cin >> customer[id].name;
        std::cout << id <<"| phone: ";
        std::cin >> customer[id].phone;
        std::cout << id <<"| dimensions: ";
        std::cin >> customer[id].dimensions;
        std::cout << id <<"| color: ";
        std::cin >> customer[id].color;
    }
    std::ofstream data("invoices.bin", std::ios::binary);
    data.write((char*)customer, sizeof(customer));
    data.close();
    return 0;
}
Read Structures
#include <iostream>
#include <fstream>
typedef struct{
    std::string name;
    std::string phone;
    std::string dimensions;
    std::string color;
}Customer;
int main()
{
    Customer customer[2]; // number of customers
    std::ifstream data("invoices.bin", std::ios::binary);
    data.read((char*)&customer, sizeof(customer));
    puts("Reading...");
    for(int id = 0; id < 2; ++id)
    {
        std::cout << id << "| name: " << customer[id].name << "\n";
        std::cout << id << "| phone: " << customer[id].phone << "\n";
        std::cout << id << "| dimensions: " << customer[id].dimensions << "\n";
        std::cout << id << "| color: " << customer[id].color << "\n";
    }
    data.close();
    return 0;
}