summaryrefslogtreecommitdiffstats
path: root/Bachelor/Prog2/Studenten/StudDat.cpp
diff options
context:
space:
mode:
authorSven Eisenhauer <sven@sven-eisenhauer.net>2023-11-10 15:11:48 +0100
committerSven Eisenhauer <sven@sven-eisenhauer.net>2023-11-10 15:11:48 +0100
commit33613a85afc4b1481367fbe92a17ee59c240250b (patch)
tree670b842326116b376b505ec2263878912fca97e2 /Bachelor/Prog2/Studenten/StudDat.cpp
downloadStudium-33613a85afc4b1481367fbe92a17ee59c240250b.tar.gz
Studium-33613a85afc4b1481367fbe92a17ee59c240250b.tar.bz2
add new repoHEADmaster
Diffstat (limited to 'Bachelor/Prog2/Studenten/StudDat.cpp')
-rw-r--r--Bachelor/Prog2/Studenten/StudDat.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/Bachelor/Prog2/Studenten/StudDat.cpp b/Bachelor/Prog2/Studenten/StudDat.cpp
new file mode 100644
index 0000000..12f0199
--- /dev/null
+++ b/Bachelor/Prog2/Studenten/StudDat.cpp
@@ -0,0 +1,35 @@
+// Persistence of objects: Storing of Student-Objects
+// Author: Hans-Peter Weber
+// Date: 07.03.05
+
+#include <iostream>
+using std::cout;
+using std::endl;
+using std::ios;
+
+#include <fstream>
+using std::fstream;
+
+#include "Student.h"
+
+int main()
+{
+ Student stud;
+
+ cout << "Adresse von Student-Objekt: " << &stud << endl;
+ cout << "Groesse von Student-Objekt: " << sizeof( Student ) << " Byte" << endl;
+
+/* fstream outFile( "Studs.seq", ios::binary | ios::out ); // write
+ stud.set( "Hans Castorp", 578111, 23 );
+ stud.write( outFile );
+ stud.set( "Claudia Chauchat", 578666, 27 );
+ stud.write( outFile );
+ outFile.close();
+*/
+ fstream inFile( "Studs.seq", ios::binary | ios::in ); // read
+ while( stud.read( inFile ) )
+ stud.print();
+ inFile.close();
+
+ return 0;
+} \ No newline at end of file