Sign in to follow this  
SomePerson

Using classes as declarers

Recommended Posts

SomePerson    122
I made a class A51Color to hold color information. Now, I can use it as a declarer. Ex: A51Color myColor; This will create a variable myColor after A51Color. I later created a A51String class and A51Image class. When I try to used A51String as a declarer in the A51Image class it gives like 20 errors saying it is not a declarer. it is A51Image :: A51Image( int type, A51String file ); I have included it and everything possible i know. Does anyone know another reason why I cannot use A51String as a declarer name. It should work right? NOTE: I do not know if this is true but A51Color is very small in only the .h file but A51String is large and is in .h and .cpp files. Does that make a difference? Thank you

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
Impossible to tell from the information you provided, but if I had to take a guess... Maybe you forgot the semicolon at the end of the class declaration, that can lead to some strange error messages sometimes. Your second question I'm not quite sure I understand at all.

Share this post


Link to post
Share on other sites
SomePerson    122
Yes, I included it and it not that annoying semicolon thing. Here ill put in another way. I have:

// A51Image overloaded constructor
A51Image( int type, A51String file);

This should compile making a Constructor that gets a image type ( the int ) and get a filename, but it give me errors saying the class A51String is not a declarer. Though if i comment (// ... ) out that line the class compiles. I want to know if anyone know why the compiler will not allow my class to act as a declarer? I know it should.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
Those are the top errors, right? Could be a typo somewhere nearby, before that line. Can't really say without the code in A51Image.h

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this