goobers
March 15th, 2005, 10:58 AM
Hi,
i Have the following code:
using namespace std;
char str[2000];
string file = "foo.txt";
char* cwd = getcwd(NULL, 0);
string path = cwd;
free(cwd);
(path += "/") += file;
fstream file_op(path.c_str(), ios::in);
file_op.getline(str,1999);
file_op.close();
problem is i am getting an error during compile:
error C2872: 'fstream' : ambiguous symbol
i searched and i found that it might have something to do with headers. These are the headers i used:
#include <windows.h>
#include <fstream.h>
#include <direct.h>
#include <string>
(note that the above is only a portion of the full code)
anyone know what is causing the error? thanks
i Have the following code:
using namespace std;
char str[2000];
string file = "foo.txt";
char* cwd = getcwd(NULL, 0);
string path = cwd;
free(cwd);
(path += "/") += file;
fstream file_op(path.c_str(), ios::in);
file_op.getline(str,1999);
file_op.close();
problem is i am getting an error during compile:
error C2872: 'fstream' : ambiguous symbol
i searched and i found that it might have something to do with headers. These are the headers i used:
#include <windows.h>
#include <fstream.h>
#include <direct.h>
#include <string>
(note that the above is only a portion of the full code)
anyone know what is causing the error? thanks