Hey,
Any ideas why the following program doesn't work? It gives this error in MS Visual C++ 6:
Error spawning cl.exe
Andd the following errors in Dev-C++:
[Warning] In function `int main()':
11 no matching function for call to `ifstream::get (char[20])'
124 C:\DEV-CPP\include\g++-3\iostream.h
candidates are: class istream & istream::get(char *, int, char = '\n')
126 C:\DEV-CPP\include\g++-3\iostream.h
class istream & istream::get(unsigned char *, int, char = '\n')
127 C:\DEV-CPP\include\g++-3\iostream.h
class istream & istream::get(char &)
128 C:\DEV-CPP\include\g++-3\iostream.h
class istream & istream::get(unsigned char &)
132 C:\DEV-CPP\include\g++-3\iostream.h
class istream & istream::get(signed char &)
134 C:\DEV-CPP\include\g++-3\iostream.h
class istream & istream::get(signed char *, int, char = '\n')
144 C:\DEV-CPP\include\g++-3\iostream.h
class istream & istream::get(streambuf &, char = '\n')
173 C:\DEV-CPP\include\g++-3\iostream.h
int istream::get()
Source:
return 0;
}
Any ideas why the following program doesn't work? It gives this error in MS Visual C++ 6:
Error spawning cl.exe
Andd the following errors in Dev-C++:
[Warning] In function `int main()':
11 no matching function for call to `ifstream::get (char[20])'
124 C:\DEV-CPP\include\g++-3\iostream.h
candidates are: class istream & istream::get(char *, int, char = '\n')
126 C:\DEV-CPP\include\g++-3\iostream.h
class istream & istream::get(unsigned char *, int, char = '\n')
127 C:\DEV-CPP\include\g++-3\iostream.h
class istream & istream::get(char &)
128 C:\DEV-CPP\include\g++-3\iostream.h
class istream & istream::get(unsigned char &)
132 C:\DEV-CPP\include\g++-3\iostream.h
class istream & istream::get(signed char &)
134 C:\DEV-CPP\include\g++-3\iostream.h
class istream & istream::get(signed char *, int, char = '\n')
144 C:\DEV-CPP\include\g++-3\iostream.h
class istream & istream::get(streambuf &, char = '\n')
173 C:\DEV-CPP\include\g++-3\iostream.h
int istream::get()
Source:
Code:
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
char text[20];
ifstream fileread("C:\\moo.txt");
fileread.get(text);
fileread.close();
cout << "Content-type: text/html\n\n<html>\n<body>\n";
cout << "<p>" << text << "</p>";
cout << "</body>\n</html>\n";
}