Welcome to My Blog 👋

Java, Spring Framework, Microservices, Docker, Kubernetes, AWS and Others 🚀
Follow Me

Nesneye Yönelik Programlama (C++) - Ostream



  December 10, 2015    Labels:,,, 

Çanakkale Onsekiz Mart Üniversitesi Bilgisayar Mühendisliği Bölümü nesneye yönelik programlama (C++) ders notlarım.

Ostream


#include <iostream>

using namespace std;

class tarih{
    int gun,ay,yil;
public:
    tarih(int g,int a,int y){
    gun = g;  ay=a;   yil=y;
    }
    friend ostream& operator<<(ostream& os,const tarih& t);
};

ostream& operator<<(ostream& os,const tarih& t){
                    os << t.gun << '/' << t.ay << '/' << t.yil;
                    return os;
}
int main()
{
  tarih t(5,6,92);
  cout << t;
}


1 comment: