主题:谁帮我看看 这个问题是为什么?
#ifndef tree_h
#define tree_h
#include<iostream>
class tree{
int height;
public:
tree(int treeheight):height(treeheight){}
~tree(){std::cout<<"*";}
friend std::ostream&
operator<<(std::ostream& os,const tree* t){
return os<<"tree height is:"
<<t->height<<std::endl;
}
};
#endif//tree_h///:~
#include "tree.h"
using namespace std;
int main()
{
tree* t=new tree(40);
cout<<t;
delete t;
}
老出现这个问题
D:\C语言程序\tree.cpp(17) : fatal error C1083: Cannot open include file: 'tree.h': No such file or directory
#define tree_h
#include<iostream>
class tree{
int height;
public:
tree(int treeheight):height(treeheight){}
~tree(){std::cout<<"*";}
friend std::ostream&
operator<<(std::ostream& os,const tree* t){
return os<<"tree height is:"
<<t->height<<std::endl;
}
};
#endif//tree_h///:~
#include "tree.h"
using namespace std;
int main()
{
tree* t=new tree(40);
cout<<t;
delete t;
}
老出现这个问题
D:\C语言程序\tree.cpp(17) : fatal error C1083: Cannot open include file: 'tree.h': No such file or directory