Your buffer addressing is wrong, it should be:
test_usernames_c.write(default_user->username, 7);
test_usernames_c.close();
char *usernameX;
usernameX = new char[7];
test_usernames_c.seekg(pos_file, ios::beg);
test_usernames_c.read(usernameX, sizeof(char) * 7);