//dinamik.cpp
//dinamik bellek kavrami
#include <iostream.h>
struct tarih { //struck u daha görmedigimiz
int ay; //icin su an buraya egilmeyin.
int gun;
int yil;
};
void main()
{
int i, *is1, *is2; // i bir sabit ve *is1, *is2 isaretcilerimiz
is1 = &i;
*is1 = 77;
is2 = new int;
*is2 = 178;
cout << "Degerler "<<i<<" "<<*is1<<" "<<*is2<<"\n";
is1 = new int;
is2 = is1;
*is1 = 95454;
cout << "Degerler "<<i<<" "<<*is1<<" "<<*is2<<"\n";
delete is1;
float *float_is1, *float_is2 = new float;
float_is1 = new float;
*float_is2 = 3.14159;
*float_is1 = 2.4 * (*float_is2);
delete float_is2;
delete float_is1;
tarih *tarih_is;
tarih_is = new tarih;
tarih_is->ay = 10;
tarih_is->gun = 18;
tarih_is->yil = 1938;
cout<<tarih_is->ay<<"/"<<tarih_is->gun<<"/"<<tarih_is->yil<<"\n";
delete tarih_is;
char *c_is;
c_is = new char[37];
delete [] c_is;
c_is = new char[sizeof(tarih) + 133];
delete [] c_is;
}