Std::_string_alloc<std::_string_base_types<char,std::allocator<char> > >::_get_data (.) returned nullptr. As such, you will not be able to write/read person objects using ofstream::write() and ifstream::read() the way you are trying to do. Web 1 answer sorted by: You're running past yourself with your loops. If any of your software is heavily infected with malware, it can. 3 b doesn't point to anything. Inspect your computer for a malware infection. While (*sname != '\0') { stringtoupper (* sname); } you could be calling toupper to change to upper case and assigning the value back to *sname instead of having the function call itself. Then when it goes into the battle loop, this error pops up:
You have to allocate a b with make_shared: Pnode moved to index 1. If there is a handler for this exception, the program may be safely continued. Check the value returned by test.c_str () and verify you can read from that address. Std::_string_alloc<std::_string_base_types<char,std::allocator<char> > >::_get_data (.) returned nullptr. You have to allocate a b with make_shared: As such, you will not be able to write/read person objects using ofstream::write() and ifstream::read() the way you are trying to do. You will only be writing/reading the pointer values, not the actual character data. If any of your software is heavily infected with malware, it can. Web your person class has std::string members, which contain pointers to dynamically allocated data stored elsewhere in memory. B () {.} just initializes the shared_ptr instance.