Unresolved whatchmucallits

This is a discussion on Unresolved whatchmucallits within the C++ Programming forums, part of the General Programming Boards category; ok here is the code Code: #include <iostream.h> #include <iomanip.h> class Savings { private: float balance; float rate; float interest; ...

  1. #1
    Registered User
    Join Date
    Apr 2003
    Posts
    78

    Unresolved whatchmucallits

    ok here is the code
    Code:
    #include <iostream.h>
    #include <iomanip.h>
    
    class Savings
    {
    private:
    	float balance;
    	float rate;
    	float interest;
    	
    public:
    	Savings(float=0,float=0,  float=0); //constructor function with defaults
        intearned(float,float, float); //member function to copy car info
    	void showearn(void);
    };
    
    //implementation section
    Savings::intearned(float bal, float rte, float intrst)
    {
    	
    	balance=bal;
    	rate=rte;
    	interest=intrst;
    
    }
    
    
    void Savings::showearn(void)
    {
    cout<<"The earnings are";
    
    cout<< setfill('0')
        <<setw(2) << "the rate of" <<  rate
    	<<setw(2) << "has earned" << interest
    	<<setw(2) << "the balance is now"<< balance ; 
    cout<<endl;
    return;
    }
    int main()
    {
    	Savings a, c(6, 500, 1200);
    	
    
    	
    
    	cout<<endl;
    	
    	a.showearn();
    	
    	c.showearn();
       
    	cout<<endl;
    
    	return 0;
    }
    and here is the error I keep recieving
    and I quote"unresolved external symbol "public: __thiscall Savings::Savings(float,float,float)" (??0Savings@@QAE@MMM@Z)

    please helllllllp meeeeee!!!!

  2. #2
    Registered User
    Join Date
    Mar 2004
    Posts
    220
    Can you use a function before you define it? o.o
    OS: Windows XP Pro CE
    IDE: VS .NET 2002
    Preferred Language: C++.

  3. #3
    Registered User
    Join Date
    Apr 2004
    Posts
    16
    Unless it is a pre-defined C++ function, no you cannot.

  4. #4
    Registered User jlou's Avatar
    Join Date
    Jul 2003
    Posts
    1,088
    You also can't use a function if you don't define it at all.

    You need to define the Savings constructor. What you'll probably want to do is just have it call intearned with the passed in values.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compiling sample DarkGDK Program
    By Phyxashun in forum Game Programming
    Replies: 6
    Last Post: 01-27-2009, 03:07 AM
  2. C++ std routines
    By siavoshkc in forum C++ Programming
    Replies: 33
    Last Post: 07-28-2006, 01:13 AM
  3. Including lib in a lib
    By bibiteinfo in forum C++ Programming
    Replies: 0
    Last Post: 02-07-2006, 02:28 PM
  4. debug to release modes
    By DavidP in forum Game Programming
    Replies: 5
    Last Post: 03-20-2003, 03:01 PM
  5. Unresolved external symbols in OGL
    By Shadow12345 in forum Game Programming
    Replies: 4
    Last Post: 08-04-2002, 10:46 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21