|
From: Daniel A. <bt...@ca...> - 2001-10-21 17:24:41
|
Hello,
A seemingly simple problem has stumped me so far. I cannot figure out =
how to use simple strings in my programs. Do I need to add the =
<cstring.h> library? If so, my compiler says it can't find it- can I =
download this somewhere? I know I can get around this problem by using =
an array of chars, but I want to be able to use strings. I am using Dev =
4.01 and the mingw compiler 2.95.2-1. A thousand thanks for any help.
D
When I try to compile this program, I can a 'string' undeclared (first =
use this function) error.
// start
#include <iostream.h>
#include <iomanip.h> // For setw()
#include <fstream.h> // For file I/O
#include <string.h>
using namespace std;
int main()
{=20
string s1;
char pause;
cin >> s1;
cout << endl << s1 << endl;
cout << "pause";
cin >> pause;
return 0;
}
|