Help My program only creates the empty file.txt, could you help me to make the data that you enter in it be saved in the file.
void agregar(){
system("cls");
system ("color 3e");
fflush(stdin);
printf("\n%d.Nombre de contacto: ", (cont+1));
gets(control[cont].nom);//getline (cin,nom)
fflush(stdin);
cout<<"\nApellido de contacto: ", (cont+1);
gets(control[cont].ap);
fflush(stdin);
cout<<"\nTelofono: ";
scanf("%d", &control[cont].tel);
fflush(stdin);
cout<<"\nDirecci2n: ";
gets(control[cont].dir);
fflush(stdin);
cout<<"\nDepartamento: ";
gets(control[cont].dep);
cont++;
}
void escribir ()
{
ofstream archivo;
archivo.open("guia telefonica.txt",ios::out);//abrir el archivo
archivo.close();//cerrar el archivo
}