RidaSana
RidaSana

Reputation: 563

strange string error

program:

 CCompussGradientOperator dlg;
  string p = "preqitt";
  string k = "Kirnch";
  string r3 = "Robison";
  f(dlg.DoModal() == IDOK)
      {
    CDib dib = m_Dib;
    BOOL ret = FALSE;

    if(dlg.m_Combo_Operators == p )
    {
       switch(dlg.m_nFunction)
       {
       case 0: ret ;
       }
    }

}

error:

Error 18 error C2065: 'string' : undeclared identifier d:\2nd\imagetool\imagetooldoc.cpp 870 1 ImageTool

string is a data type then why it does make me error.. its strange for me... any one can help me ..thanks

Upvotes: 0

Views: 92

Answers (2)

eduffy
eduffy

Reputation: 40252

Change string to std::string. Also, do you have #include <string> at the top of the source file?

Upvotes: 1

Mahesh
Mahesh

Reputation: 34655

Have you included <string> header ? Also it is in namespace std.

Upvotes: 3

Related Questions