Skip to content

Commit

Permalink
ver
Browse files Browse the repository at this point in the history
  • Loading branch information
larafava committed Nov 21, 2023
1 parent 1291ef4 commit 463aff7
Showing 1 changed file with 17 additions and 42 deletions.
59 changes: 17 additions & 42 deletions Proyecto/main/main.cpp
Original file line number Diff line number Diff line change
@@ -1,48 +1,23 @@
#include<iostream>
#include<fstream>
#include "funciones.h"
using namespace std;
struct Student {
int roll_no;
string name;
};

int main() {
ofstream wf("student.dat", ios::out | ios::binary);
if(!wf) {
cout << "Cannot open file!" << endl;
return 1;
}
Student wstu[3];
wstu[0].roll_no = 1;
wstu[0].name = "Ram";
wstu[1].roll_no = 2;
wstu[1].name = "Shyam";
wstu[2].roll_no = 3;
wstu[2].name = "Madhu";
for(int i = 0; i < 3; i++)
wf.write((char *) &wstu[i], sizeof(Student));
wf.close();
if(!wf.good()) {
cout << "Error occurred at writing time!" << endl;
return 1;
}
ifstream rf("asistencias.dat", ios::out | ios::binary);
if(!rf) {
cout << "Cannot open file!" << endl;
return 1;
}
Student rstu[3];
for(int i = 0; i < 3; i++)
rf.read((char *) &rstu[i], sizeof(Student));
rf.close();
if(!rf.good()) {
cout << "Error occurred at reading time!" << endl;
return 1;
}
cout<<"Student's Details:"<<endl;
for(int i=0; i < 3; i++) {
cout << "Roll No: " << wstu[i].roll_no << endl;
cout << "Name: " << wstu[i].name << endl;
cout << endl;
}
cout<<"Hola munda1";
string rutaArchivoClases = "../Proyecto/iriClasesGYM.csv";
string rutaArchivoClientes = "../Proyecto/iriClientesGYM.csv";
string rutaArchivoAsistencias = "../Proyecto/asistencias.dat";
leerAsistencias(rutaArchivoAsistencias);
/*int cantAsistencias;
sAsistencia* asistencias = leerArchivoBinario("asistencias_1697673600000.dat", &cantAsistencias);
// "../gngng/
int cantidadClientes=0;
@@ -36,12 +71,41 @@ int main() {
// Clases* listaClases = cargarClases("iriClasesGYM", cantidadClases);
//delete[] listaClases;*/

cout << "Hola mundo!"<<endl;
return 0;
}

0 comments on commit 463aff7

Please sign in to comment.