|
-
Jan 5th, 2002, 02:49 PM
#1
Thread Starter
Frenzied Member
I don't have string.h can't you post it?
-
Jan 5th, 2002, 02:52 PM
#2
Monday Morning Lunatic
string.h is part of the Standard C Library.
string is part of the Standard C++ Library.
Therefore you must have them
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Jan 5th, 2002, 03:01 PM
#3
Thread Starter
Frenzied Member
Code:
#include<iostream>
#include <string>
int main()
{
cout<<"enter your name: ";
string name;
cin>>name;
cout<<name;
return 0;
}
C:\Windows\Desktop\C++\count to a billion\billion.cpp(8) : error C2065: 'string' : undeclared identifier
C:\Windows\Desktop\C++\count to a billion\billion.cpp(8) : error C2146: syntax error : missing ';' before identifier 'name'
C:\Windows\Desktop\C++\count to a billion\billion.cpp(8) : error C2065: 'name' : undeclared identifier
-
Jan 5th, 2002, 03:03 PM
#4
Monday Morning Lunatic
You forgot your using namespace std;
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Jan 5th, 2002, 03:08 PM
#5
Thread Starter
Frenzied Member
isn't that quite frustrating
I still get this: no idea how to start reading it hehe
no operator defined which takes a right-hand operand of type 'class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >' (or there i
s no acceptable conversion)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|