Results 1 to 5 of 5

Thread: I found 2 advanced books! Which is better?

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jul 1999
    Posts
    1,800
    I don't have string.h can't you post it?

  2. #2
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    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

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Jul 1999
    Posts
    1,800
    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

  4. #4
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    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

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    Jul 1999
    Posts
    1,800
    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
  •  



Click Here to Expand Forum to Full Width