C ++会员声明

时间:2014-03-12 01:07:19

标签: c++ declaration

我遇到方法声明问题。我对C ++很陌生,所以我希望有人可以提供帮助。我包括我的标题和部分内容。我的源文件

#ifndef HEADER_H
#define HEADER_H

#include <fstream>

using namespace std;

class employee
{
public:
void readData(ifstream & inf);

void Compute (int bp);

void print (ofstream & outf) const;

employee();

private:

int ID;
int Job_class;
int Years;
int Ed;
float sal;
};

#endif

现在是源文件,我在void employee :: readData(ifstream&amp; inf)收到错误 未找到会员声明。我在这里错过了什么

#include <iostream>
#include <fstream>
#include <iomanip>
#include "employee.h"

using namespace std;

void employee ::readData(ifstream& inf)

{
inf >> ID >> Job_class >> Years >> Ed;

0 个答案:

没有答案