0

I have my two classes built, one actually uses the other as a data member. Now I need to call that object to fill an array and don't know the syntax to do it.

The two classes are in this thread
http://www.daniweb.com/forums/thread114985.html

The function prototype looks like this

void statistics (int rollarray[], int rollarraysize, int rollresults[]);

I'm trying to call the threedice object to fill the rollarray, and then I was going to use a switch statement to "sort" that data into the rollresults array.

1
Contributor
2
Replies
3
Views
9 Years
Discussion Span
Last Post by henpecked1
0

Okay, over an hour and 39 views without a reply, is it that uninteresting or am I really being that much of a doofus?

1

here is what I have written so far but I don't know what goes in the for loop, and I don't know if I've declared the object correctly

void statistics (int rolls[];int rollsize; int rollresults [])
threedice tryerluk;
rollsize=200;
rolls[rollsize];
rollresults[16];

for (int i=0;i<201;i++)
{
   tryerluk.rollem();
   rolls[i]=tryerluk.getsumFaces();
}

This gives me a heap of missing type specifier and syntax errors back in the threedice class data members (from class onedie) It says missing type specifier-int assumed C++ does not support default int. What am I missing?

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.