C++ Örnekleri 65 – Yapıcı ve Yıkıcı Fonksiyonlar

#include <iostream>
#include <conio.h>
using namespace std;
// parametre aldırma

class deneme{
      int a,b;
      public:
             deneme(int x,int y){
                        a=x;
                        b=y;
                        }
                                                
              void goster(){
                         cout << a << endl << b;
                   }                  
      };

main(){
       
       deneme test(15,45);
       test.goster();
       
       getch();
       return 0;    
       }

Bir cevap yazın

E-posta hesabınız yayımlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir