-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdatos.cpp
More file actions
55 lines (42 loc) · 979 Bytes
/
datos.cpp
File metadata and controls
55 lines (42 loc) · 979 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#include <iostream>
#include <stdlib.h>
#include <stdio.h>
#include <iomanip>
using namespace std;
struct datosPersonales
{
string Nombre;
int Nacimiento;
char tiposangre;
int sexo;
char CURP[20];
int signo;
string nacionalidad;
string direccion;
int tel;
float estatura;
float peso;
};
int main()
{
//FILE *archivo;
//ofstream guardar("data.txt");
//guardar<<"holas"
//archivo = fopen("datos.txt", "w");
ofstream archivo;
archivo.open("datos.txt");
// objeto de la clase ofstream
struct datosPersonales sujeto;
cout<<"Mande datos"<<endl;
cout<<"Mande nombre"<<endl;
archivo << sujeto.Nombre << endl;
archivo << "Segunda línea de texto" << endl;
archivo << "Última línea de texto" << endl;
//cin>>sujeto.Nombre;
//string aux= sujeto.Nombre;
cout<<"Mande nacimiento"<<endl;
//cin>>sujeto.Nacimiento;
//fprintf(archivo, "aux" ,1 );
//delete []archivo;
archivo.close();
}