poly.cpp:19: error: expected constructor, destructor, or type conversion before '<' token
poly.cpp:25: error: expected unqualified-id before "void"
poly.cpp:39: error: `poly operator=(poly)' must be a nonstatic member function
poly.cpp:39: error: `poly operator=(poly)' must take exactly two arguments
Name:
Anonymous2010-05-02 19:26
It looks like your problem is that you are using the following bugs in your C compiler: templates, iostreams, operator overloading, and classes. Try rewriting the code for C99 compliance and compile it again.
Name:
Anonymous2010-05-02 19:29
>>1
Did your cat barf on your keyboard? This code looks like vomit. Lessons on properly indenting code and using the [code] tags should be a part of every introductory programming course.
Name:
Anonymous2010-05-02 19:30
>>2
What if your C compiler doesn't support C99? I'm looking at you, cl.exe.
template<class T>
line 19 poly::list<T> getone() {
};
template<class T>
line 25 poly::void setone(list<T> l) {
};
poly::poly operator +(poly rhs) {
}
poly::poly operator -(poly rhs) {
}
poly::poly operator =(poly rhs) {
}
std::ostream& operator <<(std::ostream&, poly){}
std::istream& operator <<(std::istream&, poly&){}
poly.cpp:19: error: expected constructor, destructor, or type conversion before '<' token
poly.cpp:25: error: expected unqualified-id before "void"
poly.cpp:39: error: `poly operator=(poly)' must be a nonstatic member function
poly.cpp:39: error: `poly operator=(poly)' must take exactly two arguments