Nope. You can't do it like that. Make a class, place bad1,bad2 and bad3 just below the class, so it is available to all the functions of the class. Then set the them as appropriate:
[highlight=c++]class Crap
{
private:
int bad1;
int bad2;
int bad3;
public:
int table () {
bad1 = rand() % 8 + 1;
bad2 = rand() % 8 + 1;
bad3 = rand() % 8 + 1;
return game ();
};
int game () {
int badl1 = bad1;
int badl2 = bad2;
int badl3 = bad3;
return 0;
};
};[/highlight]
Use it like this:
[highlight=c++]void main()
{
Crap c;
c.table();
}[/highlight]