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

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

class deneme{
      int a,b,c;
      public:
             deneme(int x,int y,int z){
                        a=x;
                        b=y;
                        c=z;
                        }

              void goster(){
                         cout << a << endl << b << endl << c;
                   }                   
      };

main(){

       int k,l,m;
       cout << "3 tane sayi giriniz";
       cin >> k >> l >> m;

       deneme test(k,l,m);
       test.goster();

       getch();
       return 0;    
       }

Bir cevap yazın

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