i did not get the Binary part like how u are using reinterpret and how u are using, i have not studied it so can u name the topic so i can go through it
The short answer is that reinterpret_cast is like static_cast, but for pointers. The read and write methods require a pointer of type char, but if you are writing a double memory location, then you can't just pass a double pointer. You need to cast it. reinterpret_cast tells the compiler to treat it's argument as the given type.
Q.) What to do if my vscode on doing tellg and seekg returns -1 all the time and gives error and works sometime when i dont use too many modes but thats also fails sometimes.
Thank you very much for the tutorial! I don't understand if serialization in Java is the same as outputting structs as binary in C++.
Not the same. C++ doesn't have native support of serialization.
i did not get the Binary part like how u are using reinterpret and how u are using, i have not studied it so can u name the topic so i can go through it
The short answer is that reinterpret_cast is like static_cast, but for pointers. The read and write methods require a pointer of type char, but if you are writing a double memory location, then you can't just pass a double pointer. You need to cast it. reinterpret_cast tells the compiler to treat it's argument as the given type.
Q.) What to do if my vscode on doing tellg and seekg returns -1 all the time and gives error and works sometime when i dont use too many modes but thats also fails sometimes.
Sorry, I don't understand the question.
i guess u accidentally said putg and putp :)
Very likely, my brain isn't what it used to be..