escrevendo em arquivos binários

#include <iostream>
#include <fstream>

using namespace std;

class info {

private:
    char name[15];
    char surname[15];
    int age;
public:
    void input(){
        cout<<"Your name:"<<endl;
            cin.getline(name,15);
,        cout<<"Your surname:"<<endl;
        cin.getline(surname,15);
        cout<<"Your age:"<<endl;
        cin>>age;
        to_file(name,surname,age);
    }

    void to_file(char name[15], char surname[15], int age){
        fstream File ("example.bin", ios::out  | ios::binary | ios::app);
    // I doesn't know how to fill all variables(name,surname,age) in 1 variable (memblock) 
        //example File.write ( memory_block, size ); 

File.close();
    }

};

int main(){

info ob;
ob.input();

 return 0;
}

Não sei como escrever mais de uma variável em um arquivo, por favor ajude, incluí um exemplo;) Talvez haja maneiras melhores de gravar em um arquivo, por favor me ajude com isso, é difícil para mim resolver .

questionAnswers(2)

yourAnswerToTheQuestion