title: has no member named c++
body: <p>I have some problem. I created program with dynamic stack and when I compiling get errors: <strong>'class stos' has no member named 'push' , 'class stos' has no member named 'pop' , 'class stos' has no member named 'destroy' , 'class stos' has no member named 'isempty'</strong>. In language C program is fine, but in C++ not. I have started my adventure with C++ and I don't have idea what's wrong I do. Can you help me ?  I'm putting a code:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;stdbool.h&gt;
  #include &lt;iostream&gt;
  #include &lt;conio.h&gt;
  
  using namespace std;
  
  class stos
  {
  public:
  int *tab;
  int licznik;
  int rozmiar;
  
  };
  
  void init (class stos* s)
  {
  s-&gt;licznik = 0;
  s-&gt;rozmiar = 3;
  //s-&gt;tab = (int*) malloc ( 2 * sizeof * s-&gt;tab );
  s-&gt;tab = (int*) malloc ( s-&gt;rozmiar * sizeof(int) );
  if (s-&gt;tab == NULL)
      {
      cout &lt;&lt; "Blad alokacji pamieci\n";
      abort ();
      }
  }
  
  void push (class stos* s, int element) 
  {
  if (s-&gt;licznik != s-&gt;rozmiar)
      {
      cout &lt;&lt; "Dodaj element do stosu\n";
      cin &gt;&gt; element;
      s-&gt;tab[s-&gt;licznik] = element;
      s-&gt;licznik++;
      }
  else
  {
      s-&gt;rozmiar = 2 * (s-&gt;rozmiar);
      s-&gt;tab = (int*) realloc (s-&gt;tab, (s-&gt;rozmiar) * sizeof (int));
      cout &lt;&lt; "Zwiekszono pamiec\n";
      cout &lt;&lt;"Dodaj element do stosu\n";
      cin &gt;&gt; element;
      s-&gt;tab[s-&gt;licznik] = element;
      s-&gt;licznik++;
  }
  //system ("clear");
  }
  
  int pop (class stos* s) 
  {
  if (s-&gt;licznik == 0)
  {
      cout &lt;&lt; "Nie podales zadnego elementu\n";
      abort ();
  }
  else
  {
      s-&gt;licznik--;
  }
  return s-&gt;tab[s-&gt;licznik];
  }
  
  void destroy (class stos* s)
  {
  
    free (s-&gt;tab);
  
  }
  
  bool isempty (class stos* s)
  {   
  bool empty = true;
  
  if (s-&gt;licznik == 0)
      {
    empty = true;
    cout &lt;&lt; "Stos nie posiada zadnych elementow\n";
      }
  else
      {
    empty = false;
    cout &lt;&lt; "Stos zawiera jakies elementy\n";
      }
  return empty;
  }
  
  int main () 
  {
  int element = 0, a = 0;
   stos stos1;
   stos stos2;
  
  
      do
      {
      cout &lt;&lt; "\nMENU\n\n";
      cout &lt;&lt; "STOS I\nAby dodac element do stosu wcisnij '1'\nAby odjac element ze stosu wcisnij '2'\n";
      cout &lt;&lt; "Wcisnij '3' aby usunac stos\nWcisnij '4' aby sprawdzic czy stos zawiera elementy\n\n";
      cout &lt;&lt; "STOS II\nAby dodac element do stosu wcisnij '5'\nAby odjac element ze stosu wcisnij '6'\n";
      cout &lt;&lt; "Wcisnij '7' aby usunac stos\nWcisnij '8' aby sprawdzic czy stos zawiera elementy\n\n";
      cout &lt;&lt; "Wcisnij '0' aby zakonczyc dzialanie programu\n\n";
      cin &gt;&gt; a;
      //system ("clear");
  
      if (a == 1)
      {
          stos1.push (element); 
      }
      if (a == 2)
      {
          cout &lt;&lt; "Usunieto element:" &lt;&lt; stos1.pop;
  
      }
      /*if (a == 3)
      {
          destroy (&amp;stos1);
          printf ("Wyczyszczono stos 1\n");
      }*/
      if (a == 4)
      {
          stos1.isempty;
      }
      if (a == 5)
      {
          stos2.push (element);
      }
      if (a == 6)
      {
          cout &lt;&lt; "Usunieto element: " &lt;&lt; stos2.pop;
  
      }
      /*if (a == 7)
      {
          destroy (&amp;stos2);
          printf("Wyczyszczono stos 2\n");
      }*/
  
      if (a == 8)
      {
          stos2.isempty;
      }
  }
  while (a!=0);
      destroy (&amp;stos1);
      destroy (&amp;stos2);
  getch();
  return 0;
  }
  </code></pre>