Results 1 to 4 of 4

Thread: Class question - solved

Threaded View

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2001
    Location
    I'm mobile
    Posts
    166

    Class question - solved

    Why do I have to have these things that are marked in bold below in the code?

    Code:
    class keeper
    {
    private:
    	int hours;
    	int minutes;
    public:
    	keeper();
    	keeper(int s, int p);
    	void addKeeper(int, int);
    	void writeKeeper(keeper &k);
    	keeper getKeeper(keeper &h, char *name);	keeper operator+(const keeper &k) const;
    	void show();
    	~keeper() {};
    };
    .
    .
    .
    keeper keeper::getKeeper(keeper &h, char *name)
    {
    	ifstream fin;
    	fin.open(name);
    
    	for(int i=0;i<3;i++)
    	{
    		switch(i)
    		{
    		case 0: fin >> h.hours;
    			break;
    		case 1: fin >> h.minutes;
    			break;
    		}
    	}
    	fin.close();
    
    	return h;
    
    
    }
    I know I can't have void keeper::........, but why do I have to have keeper beofre the code?

    thanx
    Last edited by [praetorian]; Dec 28th, 2001 at 05:29 PM.
    [p r a e t o r i a n]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width