Jump to content
  • Advertisement

Archived

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

RedRabbit

Instances?

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

Hey all, noob question on instances. Ive read in various places an instance is an occurance...can anybody please elaborate? Thanks (IRL Examples help me best thx again )

Share this post


Link to post
Share on other sites
Advertisement
An int is a datatype.

int iInteger;

iInteger is an instance of an int.

class CPlayer
{
// Stuff
};

CPlayer PlayerOne;

PlayerOne is an instance of CPlayer object.

Clear?

Share this post


Link to post
Share on other sites
well im not sure if im correct but if you had a class such as:


class circle
{
private:
int Centre_x;
int Centre_y;
int Radius;

public:
int Get_Radius();
int Get_Centre_X();
int Get_Centre_Y();
POINT Get_Centre();
};


if that was your class then you would make an instance of that class by doing:


#include <whatever.h>

circle Circular_Object;


well the object "Circular_Object" would be an Instance of class circle... if that makes any sense... i may not be right as i just code stuff i dont really think of the technical names of it all.. but thats what i would think an instance would be....

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!