From a4fa83c7c14215d241229d9a29a9fb8852a587bc Mon Sep 17 00:00:00 2001 From: Angel Dimitriev Date: Wed, 9 Mar 2022 16:02:25 +0200 Subject: Rename static_struct_binary.cpp to simple_struct_binary.cpp --- Sem. 03/static_struct_binary.cpp | 31 ------------------------------- 1 file changed, 31 deletions(-) delete mode 100644 Sem. 03/static_struct_binary.cpp (limited to 'Sem. 03/static_struct_binary.cpp') 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 -#include -#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; - } - -} -- cgit v1.3.1-23-gd82d