Website Summary Files Commits Branches @commit @diff @stats
path: root / Sem. 03 / static_struct_binary.cpp
diff options
context:
space:
mode:
Commita4fa83c7c14215d241229d9a29a9fb8852a587bc (patch)
Author
 Angel Dimitriev <angel_dimitriev@abv.bg>
2022-03-09 16:02:25 +0200
Committer
 GitHub <noreply@github.com>
2022-03-09 16:02:25 +0200
Filesaf0538eec4e82cebb373a337cb25c88b21f45c35 /Sem. 03/static_struct_binary.cpp
Object-oriented_programming_FMI-a4fa83c7c14215d241229d9a29a9fb8852a587bc.tar
Object-oriented_programming_FMI-a4fa83c7c14215d241229d9a29a9fb8852a587bc.tar.gz
Object-oriented_programming_FMI-a4fa83c7c14215d241229d9a29a9fb8852a587bc.zip
Parentc3a9b708770187da45ef6fded262d9c54b6cdedc (diff)
Rename static_struct_binary.cpp to simple_struct_binary.cpp
1 files changed, 0 insertions, 31 deletions
-rw-r--r--Sem. 03/static_struct_binary.cpp31
diff --git a/Sem. 03/static_struct_binary.cpp b/Sem. 03/static_struct_binary.cpp
deleted file mode 100644
index 6ee16de..0000000
--- a/Sem. 03/static_struct_binary.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-#include <iostream>
-#include <fstream>
-#pragma warning(disable:4996)
-using namespace std;
-
-
-struct Test
-{
- bool b;
- int x;
-};
-
-int main()
-{
-
- { //write
- Test t = { true, 45 };
- ofstream file("testObj.bat", ios::binary);
-
- file.write((char*)&t, sizeof(t));
- }
-
- { //read
- Test t;
- ifstream file("testObj.bat", ios::binary);
-
- file.read((char*)&t, sizeof(t));
- std::cout << t.b << " " << t.x << std::endl;
- }
-
-}