#include <iostream>
#include <cstdlib>
#include <list>
using namespace std;
class Fact
{
public:
list<Fact *> pointers;
int ID;
void setPointers(list<Fact> facts);
Fact(): ID(0){};
~Fact(){};
};
void factGenerator(int N, list<Fact> facts);
int main()
{
int N;
cout << "Enter number of Facts (N): ";
cin >> N;
list<Fact *> pointers;
list<Fact> facts;
factGenerator(N, facts);
return 0;
}
void factGenerator(int N, list<Fact> facts)
{
int i;
Fact fact[N];
for(i = 0; i <= N; i++)
{
cout << "Enter the fact #" << i+1 << ": ";
cin >> fact[i].ID;
facts.push_back(fact[i]);
}
}
void Fact::setPointers(list<Fact> facts)
{
int i;
for (list<Fact>::iterator it = facts.begin(); it != facts.end(); ++it)
{
for(i = 0; i < (rand() % 6); i++)
{
*it.facts
}
}
}
Comments
Leave a comment