There are a number of mistakes in your code.
1. If you want to read a file then why use ofstream? You should use ifstream (i is for input, you want something to input to your program). When writing you should use output file stream.
2. You say array of structs and you're using text files. So I can conclude that you want to write string to a file and then read it back and add to your structure. so variable Status is char*
it is sufficient to use only char buf[BUFFER_SIZE]
I'll show you this on a simple example and you need to figure out how to use this to solve your problem.
If you want to write whole structure to a file then you'll need to use binary files and functions read() and write()
using namespace std;
void read_file(char* buffer,int len)
// now you can do whatever you like with buffer
const int BUFFER_SIZE = 1024;
And prototype of getline is:
So you see now why you're getting a compiler error
istream & getline(char *, int, char = '\n');