c++.chat - Help!
- Nicky (25/25) Apr 19 2002 Hi,
-
Pavel Minayev
(8/18)
Apr 20 2002
Here's the problem:
doesn't define class string. It is - beeran telia.com (15/37) Aug 11 2002 Im having the same problems as this guy did and when i try this solution...
- Jan Knepper (5/18) Aug 11 2002 Where is your stl_config.h?
Hi, I tried to compile the program shown below, but got the following error message: String name: define name ^ 1.1.cpp(10) : Error: undefined identifier 'string' --- errorlevel 1 Code: // ask for a person's name, and greet the person #include <iostream.h> #include <string.h> int main(void) { // ask for the person's name cout << "Please enter your first name: "; // read the name string name; // define name cin >> name; // read into name // write a greating cout << "Hello, " << name << "!" << endl; return 0; } If anyone knows why I'm getting this error, it would be greatly appreciated! Thanks in advance, Nicky
Apr 19 2002
"Nicky" <spininc earthlink.net> wrote in message news:a9qgeb$2c38$1 digitaldaemon.com...Hi, I tried to compile the program shown below, but got the following error message: String name: define name ^ 1.1.cpp(10) : Error: undefined identifier 'string' --- errorlevel 1 Code: #include <iostream.h> #include <string.h>Here's the problem: <string.h> doesn't define class string. It is declared in <string>, and don't forget about namespacing: #include <iostream.h> #include <string> using namespace std; That should do it.
Apr 20 2002
Im having the same problems as this guy did and when i try this solution all i get is "Fatal error: unable to open input file 'stl_config.h' --- errorlevel 1" here is my code! ----------------------------------- #include <..\include\iostream.h> #include <..\stl\string> using namespace std; void main(){ cout << "hello\n"; } ----------------------------------- if i remove the "include string" it works but is of no use to me !! In article <a9sagm$1adi$1 digitaldaemon.com>, Pavel Minayev says..."Nicky" <spininc earthlink.net> wrote in message news:a9qgeb$2c38$1 digitaldaemon.com...BjornHi, I tried to compile the program shown below, but got the following error message: String name: define name ^ 1.1.cpp(10) : Error: undefined identifier 'string' --- errorlevel 1 Code: #include <iostream.h> #include <string.h>Here's the problem: <string.h> doesn't define class string. It is declared in <string>, and don't forget about namespacing: #include <iostream.h> #include <string> using namespace std; That should do it.
Aug 11 2002
beeran telia.com wrote:Im having the same problems as this guy did and when i try this solution all i get is "Fatal error: unable to open input file 'stl_config.h'Where is your stl_config.h? You might what to try: sc -I\include -I\stl Jan--- errorlevel 1" here is my code! ----------------------------------- #include <..\include\iostream.h> #include <..\stl\string> using namespace std; void main(){ cout << "hello\n"; } ----------------------------------- if i remove the "include string" it works but is of no use to me !!
Aug 11 2002