Hey guys,

I'm trying to open a file, however, I'm running into problems:

TDirectory.cpp
CODE
#include <iostream>
using namespace std;
#include <fstream>
#include "TDirectory.h"
bool Listing::loadFileData(FILE* fp){
    fseek(fp, 0, SEEK_SET);
    ifstream in(fp);
    while (in) {
        in >> givenName >> surname >> address >> telephone;
    }
}


TDirectory.h
CODE
struct Listing {
    char fname[16], lname[16], addr[16], phnum[16];

public:
    bool loadFileData(FILE *fp);
    const char* givenName() const;
    const char* surname() const;
    const char* address() const;
    const char* telephone() const;
};

struct Directory {
    FILE *fp;
    int records;
    struct Listing *listings;

public:
    bool loadFileData(const char* filename);
    void display() const;
    void close();
};


Error:
QUOTE
error C2679: binary '>>' : no operator found which takes a right-hand operand of type 'overloaded-function' (or there is no acceptable conversion)


Many thanks,
xboxrulz

 

 

 


Comment/Reply (w/o sign-up)