Jump to content
  • Advertisement

Archived

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

zip7000

include and class instruction

This topic is 5844 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

hi, I''m a little bit confused! what are the difference between : #include <A.h> and class a; Is the first instruction can always replace the second one and vice versa?

Share this post


Link to post
Share on other sites
Advertisement
#include"A.h"

here you include the header file (which maybe holds the class)

class a;

here you declare a class, what you need to fill like this

class a{
int x
a();
~a();
};


.....a header file is just another file filled with sourcecode.....often used to declare variables, functions, or classes.....

[edited by - pipo declown on August 15, 2002 7:52:18 AM]

Share this post


Link to post
Share on other sites
class A; can also be a forward reference for purposes of using A in the declaration of another class:

class A; // structure declared somewhere else
class B
{
void func(A* a); // used in this definition
};

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!