Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

iNfuSeD

Internal compiler error VC++6.0

This topic is 5303 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

here''s my class definition
#include <iostream>
using namespace std;


// Polynomial Class Definition /////////////////////////////////////////////////////
class Polynomial 
{

	// arithmetic operator overloads prototyped as friend functions
	friend Polynomial operator+(const Polynomial&, const Polynomial&);
	friend Polynomial operator+(const double, const Polynomial&);
	friend Polynomial operator+(const Polynomial&, const double);

	friend Polynomial operator-(const Polynomial&, const Polynomial&);
	friend Polynomial operator-(const double, const Polynomial&);
	friend Polynomial operator-(const Polynomial&, const double);

	friend Polynomial operator*(const Polynomial&, const Polynomial&);
	friend Polynomial operator*(const double, const Polynomial&);
	friend Polynomial operator*(const Polynomial&, const double);

public:
	
	// constructors and destructor prototypes
	Polynomial(int t);
	Polynomial();
	Polynomial(const Polynomial& p);
	Polynomial& operator=(const Polynomial& p);
	~Polynomial();

	// member function prototypes
	void changeCoefficiant(int term, double coefficiant);
	double getCoefficiant(int term);
	int numterms();

	double evaluate(double x);

private:
	double* coefficiants; // dynamic array to hold coefficiants of polynomial
	int terms; // number of terms in polynomial, including all that evaluate to 0

};  // Polynomial declaration

and it allways gives me 1 error when it reaches the line friend Polynomial operator+(const Polynomial&, const Polynomial&); ---------error----------- d:\development\eve\polynomial.cpp(10) : fatal error C1001: INTERNAL COMPILER ERROR (compiler file ''msc1.cpp'', line 1786) Please choose the Technical Support command on the Visual C++ Help menu, or open the Technical Support help file for more information Error executing cl.exe. eve.exe - 1 error(s), 0 warning(s) this is the first time i''m trying to overload the arithmetic operators and as far as I can tell i''m doing everything the book says. My definitions are all done with the same prototypes as the overloads defined outside the public: line of my class, minus friend and with the variable names for the arguments. Can someone help me out please?

Share this post


Link to post
Share on other sites
Advertisement
The problem arises from the combination of the using namespace declaration, and the friend declaration. Read all about it here. It should be solved by downloading the latest Service Pack.


"Sneftel is correct, if rather vulgar." --Flarelocke

Share this post


Link to post
Share on other sites
quote:
Original post by Invader X
Do you have the latest service pack?


Colin Jeanne | Invader''s Realm


i thought i might of.. but that might of been me confusing the remembering to get it, with remembering that i got it.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!