Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Need some help

Name: Anonymous 2010-05-02 19:17

poly::poly() {

 

};

poly::poly(const poly& l) {

  one = l.one;
};

poly::~poly() {


};


          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

Name: Anonymous 2010-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: Anonymous 2010-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: Anonymous 2010-05-02 19:30

>>2
What if your C compiler doesn't support C99?
I'm looking at you, cl.exe.

Name: Anonymous 2010-05-02 19:33

>>3

poly::poly() {

 

};

poly::poly(const poly& l) {

  one = l.one;
};

poly::~poly() {


};


          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

Name: Anonymous 2010-05-02 19:38

poly::poly operator -(poly rhs) {
You had me until here. 2/10.

Name: Anonymous 2010-05-02 19:40


#ifndef POLY_XXX
#define POLY_XXX


class poly {

 public:
  poly();
  poly(const poly& l);
  ~poly();

  double evalu(int x);
  friend list<term> getone();
  poly operator +(poly rhs);
  poly operator -(poly rhs);
  friend poly operator =(poly rhs);
  friend std::ostream& operator <<(std::ostream&, poly);
  friend std::istream& operator >>(std::istream&, poly&);

private:
  list<term> one;



};

#include "poly.cpp"
#endif

Name: Anonymous 2010-05-02 19:42

>>6
I thought it worked just like +....?

Name: Anonymous 2010-05-02 19:53


poly::putTheKettleOn();
poly::putTheKettleOn();
poly::putTheKettleOn();
LetsAllHaveTea():

Name: Anonymous 2010-05-02 20:03

>>9
I enjoyed that. Well done.

Name: Anonymous 2010-05-02 20:14

so does anyone have any idea for the first two errors at least?

would appreciate it

Name: Anonymous 2010-05-02 20:32

>>9
Back to the image boards, Soulja Boy.

Name: Anonymous 2010-05-02 20:59

does anyone have any clue and care to help?

Name: Anonymous 2010-05-02 21:03

>>12
Way to show your knowledge of mindless popular culture.
Polly put the kettle on is an ancient rhyme from medieval Britain.

Name: Anonymous 2010-05-02 21:10

>>11
Stop returning types that don't exist.

Name: Anonymous 2010-05-02 21:15

>>15
but they do exist

I'm including my template linked list class and term class in my main app... I mean I deleted the statements to save room for the board

Name: Anonymous 2010-05-02 21:33

>>16
stop using templates. they really are the gayest thing in the world.  just use void *

Name: Anonymous 2010-05-02 21:35

>>16
Stop being wrong.

Name: Anonymous 2010-05-02 21:42

>>17
template is required

>>18
YOU KNOW WHAT IN FACT IT'S LIKE I'M RETURNING NOTHING AT ALL BRB

Name: Anonymous 2010-05-02 22:14

>>14
Does it not disturb you that medieval Britain rhymes sound similar to Soulja Boy? I think that's more telling of what's mindless around here.

Name: Anonymous 2010-05-02 22:24

>>19
retuning didn't do a value didn't do a damn thing

Name: Anonymous 2010-05-02 22:37

I'M A FUCKING IDIOT

THAT IS ALL


THIS THREAD DOESN'T EXIST

EVERYONE UNDERSTAND ME?

Name: Anonymous 2010-05-03 0:44

>>22
Most people feel that way after talking to me.  I'm sorry.

Name: Anonymous 2010-05-03 4:30

>>20
NIGGERS

Name: Anonymous 2010-05-03 4:38

>>24
* African Americans

Name: Anonymous 2010-05-03 18:53

>>24
*CRACKERS

Name: Anonymous 2010-11-13 22:55

Don't change these.
Name: Email:
Entire Thread Thread List