Class stos
has no one of these member functions, looking into your code I think that you've two possible solutions. Or you add it to class stos, something like:
class stos
{
public:
int *tab;
int licznik;
int rozmiar;
void init ()
{
s->licznik = 0;
s->rozmiar = 3;
//s->tab = (int*) malloc ( 2 * sizeof * s->tab );
s->tab = (int*) malloc ( s->rozmiar * sizeof(int) );
if (s->tab == NULL)
{
cout << "Blad alokacji pamieci\n";
abort ();
}
}
void push (int element)
{
if (s->licznik != s->rozmiar)
{
cout << "Dodaj element do stosu\n";
cin >> element;
s->tab[s->licznik] = element;
s->licznik++;
}
else
{
s->rozmiar = 2 * (s->rozmiar);
s->tab = (int*) realloc (s->tab, (s->rozmiar) * sizeof (int));
cout << "Zwiekszono pamiec\n";
cout <<"Dodaj element do stosu\n";
cin >> element;
s->tab[s->licznik] = element;
s->licznik++;
}
//system ("clear");
}
...
};
or you call them in the right way:
push(&stos1, element);
instead of
stos1.push(element);
On the other hand, if you decide not to include them into stos
class, please, consider using references instead of pointers:
void push (class stos& s, int element);
Use reference wherever you can, pointers wherever you must. ;-)