点未声明 [英] Point was not declared

查看:193
本文介绍了点未声明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这里是错误:
我不知道为什么这个奇怪的错误! '点'& 'Vector'是类的Droite3D属性!
help please

here is the error: I do not know why this strange error! 'Point' & 'Vector' are "Droite3D" attribute of class! help please

    ******************************* Droite3D.h**************************



#ifndef DROITE3D_H
#define DROITE3D_H
#include<iostream>
#include<Point3D.h>
#include<Vecteur3D.h>``

class Droite3D
{
    Point3D Point;
    Vecteur3D Vecteur;

    public:

    Droite3D(Point3D p, Vecteur3D v){
        Point=p;
        Vecteur=v;
    }

    void afficher();
    void afficher ( ostream & out) const;
};

** * * * ** * ** ** **

*************** Droite3D.cpp****************

#include "Droite3D.h"
#include<iostream>

ostream & operator<< (ostream & out, const Droite3D &D)
{
    D.afficher (out);
    return out;
}
}

void afficher ( ostream & out) const{
    cout <<"\nc'est la droite definie par le point "<<Point<<" et le vecteur "<<Vecteur;


推荐答案

请使用范围解析运算符 :: ,因为它使用类 Droite3D 的变量来定义方法 afficher 提及其范围。

Please use scope resolution operator :: while defining method afficher as its using the variables of class Droite3D so you need to mention its scope.

这篇关于点未声明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆