Auto generate instances

0 Earl Hudson · October 17, 2015
Hi guys...
 
  I don't think what I want can be accomplished. But I'm going to ask on the hopes one of you guru's knows a way and I'll be presently surprised... 

This I can do, all day long with ease.
#include
#include

using namespace std;

class Monster
{
private:
    string name;
public:
    void say(string str1, string str2)
    {
        cout

Childs play...

This is what I want to do, but don't think it's possible.


#include
#include
#include
#include

using namespace std;

void Spawn (string);

class Monster
{
public:

    string name;
    void say(string str1, string str2)
    {cout
Basically, I'm looking for a way to make an object, or a variable of some type be self identifying. 
Maybe create an instance from a random pick from a container. Can this be done in any way, shape, or form?
Vector, Vector of objects, pointers?? Somewhere in memory resides the location that stores the name when you create an instance. Is there a way to tap into and manipulate that to my benefit?

Post a Reply

Replies

Oldest  Newest  Rating
0 Earl Hudson · October 17, 2015
What the hell??
 Never mind
  • 1

C++

106,986 followers
About

Used in many types of software including music players, video games, and many large scale applications.

Links
Moderators
Bucky Roberts Administrator