unbale to use string class

Discussion in 'C++' started by rawaldream, Oct 1, 2009.

  1. rawaldream

    rawaldream New Member

    Joined:
    Oct 1, 2009
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    HI all
    I am just learning the C++ programing.
    I am not able to use string class on my program. I installed turboc3 in the system.
    Include <String.h> libraray
    and there in INclude directory there is string.h file.

    but still I am getting the compilation erroe undefined name string
    I am using like this
    include <iostream.h>
    include<string.h>
    int main()
    {
    string a;
    cin >> a;
    return 0;
    }
    error message a undefined.
    string not defined

    could any one help me

    thanks in advance.
    could send me mail rawalssm@gmail.com
     
  2. xpi0t0s

    xpi0t0s Mentor

    Joined:
    Aug 6, 2004
    Messages:
    3,009
    Likes Received:
    203
    Trophy Points:
    63
    Occupation:
    Senior Support Engineer
    Location:
    England
    Try "#include" instead of "include".
     
  3. rawaldream

    rawaldream New Member

    Joined:
    Oct 1, 2009
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0

    Thanks I used the same thing.
    still unable to use String class.
     
  4. xpi0t0s

    xpi0t0s Mentor

    Joined:
    Aug 6, 2004
    Messages:
    3,009
    Likes Received:
    203
    Trophy Points:
    63
    Occupation:
    Senior Support Engineer
    Location:
    England
    Possibly string only exists in the std namespace; if so you'd have to prefix it with std::.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice