Sunday, August 25, 2013


struct constructor



[postlink]http://net4story.blogspot.com/2013/08/struct-constructor.html[/postlink]struct tanimlamalari icinde class lardaki gibi constructor fonksiyon kullanilabiliyormus ornek;


Kod:
struct swx_deneme
{
 int a[100][100][100];

 swx_deneme()
 {
  for (int i = 0; i < 100; i++)
  {
   a[i][i][i]=5;
  }
  ShowMessage("Struct Olusturudu.");
 }

};
asagidaki kodu calistirdigimizda bize struct olusturdu diye mesaj verecektir.

Kod:
swx_deneme *a;
a = new swx_deneme;

0 yorum:

Post a Comment