为什么vs.net这样提示我,“.或->左边的表达式不是类、结构或联合”
代码如下:
// cropetest.cpp : 定义控制台应用程序的入口点。
//#include "stdafx.h"//issgistl.cppusing namespace std;int main( )
{
   using namespace std;
   vector <int>::iterator v1_Iter, v2_Iter, v3_Iter, v4_Iter, v5_Iter;   // Create an empty vector v0
   vector <int> v0;   // Create a vector v1 with 3 elements of default value 0
   vector <int> v1( 3 );
   //我在下面写v1.之后应该有vector成员的列表,可是现在没有,怎么回事啊?   // Create a vector v2 with 5 elements of value 2
   vector <int> v2( 5, 2);
      // Create a vector v3 with 3 elements of value 1 and with the allocator 
   // of vector v2
   vector <int> v3( 3, 1, v2.get_allocator( ) );   // Create a copy, vector v4, of vector v2
   vector <int> v4( v2 );   // Create a vector v5 by copying the range v4[_First, _Last)
   vector <int> v5( v4.begin( ) + 1, v4.begin( ) + 3 );   cout << "v1 =" ;
   for ( v1_Iter = v1.begin( ) ; v1_Iter != v1.end( ) ; v1_Iter++ )
      cout << " " << *v1_Iter;
   cout << endl;
   
   cout << "v2 =" ;
   for ( v2_Iter = v2.begin( ) ; v2_Iter != v2.end( ) ; v2_Iter++ )
      cout << " " << *v2_Iter;
   cout << endl;   cout << "v3 =" ;
   for ( v3_Iter = v3.begin( ) ; v3_Iter != v3.end( ) ; v3_Iter++ )
      cout << " " << *v3_Iter;
   cout << endl;   cout << "v4 =" ;
   for ( v4_Iter = v4.begin( ) ; v4_Iter != v4.end( ) ; v4_Iter++ )
      cout << " " << *v4_Iter;
   cout << endl;   cout << "v5 =";
   for ( v5_Iter = v5.begin( ) ; v5_Iter != v5.end( ) ; v5_Iter++ )
      cout << " " << *v5_Iter;
   cout << endl;   
   
}

解决方案 »

  1.   

    不妨用用 visual assist
    比较不错 节约时间。
      

  2.   

    :(惭愧,还从来没用过vs.netUp2U
      

  3.   

    你能确定你的对象或指针定义正确吗?如果真的没问题,关掉IDE,在你的程序的所在的文件夹中删除NCB文件,再进去试试
      

  4.   

    编译运行都没问题,main里面的东西是msdn的示例,我在main外面的那个using namespace std;忘记删掉了
    “在你的程序的所在的文件夹中删除NCB文件”
    好像没效果
      

  5.   

    在VC.NET版中给你的建议是一个验证成功后的结论。
      

  6.   

      
         删掉NCB文件试下...
      

  7.   

    to: ahu9870(阿胡9870) 
    我试了,不行啊……