#include <vcl.h>
#include <conio.h>
#include <stdio.h>
#pragma hdrstop

class Students
{
 public:
    Students(){puts("Konstruktor klasy wywolany tylko 1 raz\n");}
   // konstruktor klasy
   ~Students(){puts("Wywolany destruktor klasy\n\n") ;}
   // destruktor  klasy

   AnsiString GetName(int i){return Name[i];}
   void SetName(int i, const AnsiString names){Name[i]=names;}
   AnsiString Name[4];
} Person; //egzemplarz Person (osoba) klasy Students
//---------------------------------------------------------
void Show1(Students ClassInstance); // prototyp funkcji show1()
void Show2(Students ClassInstance); // prototyp funkcji show2()
//----------------------------------------------------------
int main()
{
  Show1(Person);
  Show2(Person);
  getch();
  return 0;
}
//------------------------------------------------------------
void Show1(Students ClassInstance)
{
  ClassInstance.Name[0]="Wacek";
  ClassInstance.Name[1]="Janek";
  ClassInstance.Name[2]="Jola";
  for (int i = 0; i <= 2; i++)
    puts(ClassInstance.Name[i].c_str());
  return;
}
//---------------------------------------------------------
void Show2(Students ClassInstance)
{
  ClassInstance.Name[0]="Kasia";
  ClassInstance.Name[1]="Marysia";
  ClassInstance.Name[2]="Wicek";
  for (int i = 0; i <= 2; i++)
    puts(ClassInstance.Name[i].c_str());
  return;
}

