Mail Archives: djgpp/1996/10/28/12:40:17
On Sun, 27 Oct 1996, Stephen Baker wrote:
> I have made all the changes that you suggested. Unfortunately, the
> results are the same. Strings are not recognized.
No, the results are totally different: this time you see a genuine
compiler error message which quite rightfully tells you there is a bug in
your program:
src\\stars2.cc: In function `int main()':
src\\stars2.cc:7: `string' undeclared (first use this function)
And the culprit is this line:
#include <string.h>
It should say this instead:
#include <string>
or this:
#include <std/string.h>
If you use source code from some C++ book, be sure to check that the
headers they mention are indeed what the program expects. Since C++ has
no ANSI standard yet, some details may vary between different compilers
and even between different versions of the same compiler.
- Raw text -