void kopyala() { sayi=ilk.getZaman();
A time_t is not a long!
birinci=ctime(&sayi); cout.flush(); fflush(stdin);

sayi1=son.getZaman(); cout<<"birinci:"<<birinci<<endl;//1 cout.flush(); fflush(stdin);
sonuncu=ctime(&sayi1); cout<<"birinci:"<<birinci<<endl;//2 cout<<"sonuncu:"<<sonuncu<<endl;//3 //1 and 2 prints different values
Yes. ctime() returns a static pointer to a char. Every time you call
it, it will modify it. You should copy that string as soon as you get
it: