I was given a task to write a file system in Linux that simulates a storage device as a file.
One of the functions I was given needs to read data inside a "file". To do so I have a function that's supposed to return an std::string.
How can I read the data out of the file with the following function
directly into an std::string?
void read(int addr, int size, char *ans)
Is there a way to pass the char array inside of an std::string as a parameter to this function?
All of the methods and member functions I have encountered so far only return const char* which doesn't work in this case.
Thanks!