Thread: string.h help

  1. #1
    Registered User
    Join Date
    Apr 2002
    Posts
    2

    string.h help

    I bought a used copy of Learning to Program in C++ by Steve Heller. It ususally comes with DJGPP Compiler, but mine was used and didn't have it. I just use Borland C++ 5.0
    Anyways one of the examples in the book has

    #include "string6.h"

    my guess is for the part in the code that says

    string answer;

    Anyways when I compile the program I get

    Unable to open include file 'string6.h'
    Undefind symbol 'string'

    I'm guessing that Borland 5 doesn't use the header string6.h and only DJGPP does, but I can't find what the substitute would be for Borland so I can make this program work. Please help.



    Here is the whole source if needed
    __________________________________________________ __
    #include <iostream.h>
    #include "string6.h"

    int main()
    {
    string answer;

    cout << "Please respong to the following statement ";
    cout << "with either true or false\n";

    cout << "Susan is the world's most tenacious novice.\n";
    cin >> answer;

    if(answer !="true")
    if(answer !="false")
    cout << "Please answer with either true or false.";

    if(answer =="true")
    cout << "Your answer is correct\n";

    if(answer=="false")
    cout << "Your answer is erroneous\n";

    return 0;
    }
    Last edited by gcnmetroid; 04-29-2002 at 11:24 PM.

  2. #2
    Registered User
    Join Date
    Oct 2001
    Posts
    2,934
    Try:
    #include <string>

  3. #3
    Registered User
    Join Date
    Apr 2002
    Posts
    2

    Talking

    Thanks it worked.

    Feel free to give me the n00b of the day award.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Understanding strtok from string.h library
    By yougene in forum C Programming
    Replies: 6
    Last Post: 03-07-2008, 01:14 AM
  2. Where is strcpy() defined? (Can't find in string.h ect)
    By Zero_Point in forum C++ Programming
    Replies: 6
    Last Post: 04-03-2006, 05:14 PM
  3. censor text without string.h & afx.h
    By slimshady783 in forum C++ Programming
    Replies: 1
    Last Post: 02-09-2003, 10:58 PM
  4. string.h
    By moemen ahmed in forum C++ Programming
    Replies: 6
    Last Post: 02-09-2003, 08:41 PM
  5. string.h functions help plz :)
    By ChrisE in forum C++ Programming
    Replies: 1
    Last Post: 03-05-2002, 03:12 PM