Hey dudes and dudettes

I'm creating my first text RPG, and I'm having a little problem with File IO. I'm writing a register system using File IO, and it crashes when I write to the file. I don't want to go any further as my Login system will work on the same principles, and If they don't work, then my game doesn't work. Here are the files that I think that you will need to help me with my problem:

RegisterMgr.h
Code:
#include <iostream>
#include <fstream>

class RegisterMgr
{
    public:
    std::string sRegister(std::string sUsername, std::string sPassword);
    
    private:
    std::string m_sUsername;
    std::string m_sPassword;
    
};
RegisterMgr.cpp
Code:
#include "RegisterMgr.h"

std::string RegisterMgr::sRegister(std::string sUsername, std::string sPassword)
{
    std::ofstream oRegister("Register.txt", std::ios::app);
    sUsername = m_sUsername;
    sPassword = m_sPassword;
    oRegister << sUsername << std::endl;
    oRegister << sPassword << std::endl;
    oRegister.close();
}
When I get up to entering the desired username and password, the program crashes

Any help would be greatly appreciated.