在边程序里面难免要用的很多的类,类的使用固然简单,但是不知道怎么使用啊。
比如编什么样的程序需要什么样的类,而这些类又在哪写头文件里,是自己定义的还是系统定义的啊。也即是怎么确定编写的程序里所需要的头文件。谢谢了!

解决方案 »

  1.   

    你可以看看vc安装目录下面的include目录
      

  2.   

    MSDN上面会告诉你的,应该包含哪些文件。
      

  3.   

    大家帮忙看下到底是怎么回事啊!!好象总是说类CVector3没有定义。
    自定义类如下
    class CCamera
      {
      public:
            CCamera();
            CVector3 Position()    {return m_vPosition;} //100行
            CVector3 View()        {return m_vView;}
            CVector3 UpVector()    {return m_vUpVector;}
            CVector3 Strafe()      {return m_vStrafe;}
            void PositionCamera(float positionX,float positionY,float positionZ,float viewX,float viewY,float viewZ,float upVectorX,float upVectorY,float upVectorZ);
            void RotateView(float angle,float X,float Y,float Z);
            void SetViewByMouse();
            void RotateAroundPoint(CVector3 vCenter,float X,float Y,float Z);
            void StrafeCamera(float speed);
            void MoveCamera(float speed);
            void CheckForMovement();
            void Update();
            void Look();
      private:
            CVector3 m_vPosition;
            CVector3 m_vView;
            Cvector3 m_vUpVector;
            CVector3 m_vStrafe;
      }
    编译时出现错误:[C++ Error] Unit1.cpp(100): E2303 Type name expected(One of these errors has occurred:  In declaring a file-level variable or a struct field, neither a type name nor a storage class was given.
      In declaring a typedef, no type for the name was supplied.
      In declaring a destructor for a C++ class, the destructor name was not a type name (it must  be the same name as its class).
      In supplying a C++ base class name, the name was not the name of a class.)
    [C++ Error] Unit1.cpp(100): E2139 Declaration missing (Your source file contained a struct or union field declaration that was not followed by a semicolon.Check previous lines for a missing semicolon.)怎么搞的啊,到底怎么定义类CVector3啊,好急啊!各位大哥帮帮忙!!!
      

  4.   

    CVector3这是个什么类呀???你得先有定义才行呀,MFC中没有这个类
      

  5.   

    就是啊,还请哪位指点一下,我的目的是定义一个三维向量类,即这个类的对象是表示(x,y,z)坐标的。请教一下怎么定义啊,应该用哪个类,包含这个类的头文件是什么啊!给我示范一下。感谢!!!