OK so here is my problem, I need to create class the can read in a file to memory in binary mode I think. Here are some of the functions I have so far the first will read a file in to a char*. My next function will write a file from the char* that is stored in memory. To be honest I don't even know if i'm doing this right or if there is a better way to do it. If you could advise or give me some material to read so I can learn the right way to do this. I am looking to making this class for a 2D game engine it will be used to read in items such as sound or text files into memory and either play the music from memory. Like I said i'm just a beginner here and i'm looking for some direction.

Code:
//reads a file into a character pointer. If the function fails it will return -1 if it succedes it will return 1
int fileIO::readIntoMemroy(char* memblock, const char* filename)
{
	std::ifstream file(filename, std::ios::in | std::ios::binary | std::ios::ate);
	
	if (file.is_open())
	{
		std::ifstream::pos_type size = file.tellg();
		memblock = new char [size];
		file.seekg(0, std::ios::beg);
		file.read (memblock, size);
		file.close();
		return 1;
	}
	else
		return -1;
};
Now all I want the next function to do is take the information from "memblock" and write it to a new file.