【发布时间】:2009-05-05 05:09:05
【问题描述】:
我有一个名为 main 的程序:
#include<iostream>
#include<fstream>
using namespace std;
#include"other.h"
int main()
{
//do stuff
}
然后是其他.h:
char* load_data(int begin_point,int num_characters)
{
seekg(begin_point);
char* return_val=new char[num_characters+1];
mapdata.getline(return_val,num_characters);
return return_val;
}
我得到了错误:
'seekg': 未找到标识符
为什么会出现此错误以及如何解决?
【问题讨论】:
-
你是在头文件中定义函数吗? o.O 正确的格式是在头文件中提供函数原型,然后创建一个单独的文件(可能是 other.cpp)来实际定义 load_data 的功能。
标签: include identifier seekg