Welcome Hello all my name Ang MengEang .I created this website for IT knowlegth and watch News This blog is updating Please wait for Vsiting .My Website will be update soon Thanks very much from me !
Showing posts with label Program. Show all posts

Code CAdd Constructor



#include<conio.h>
#include<iostream>
using namespace std;
class CAdd{
public:
int one;
CAdd(int two){
cout<<"Contructor with paramater "<<endl;
one = two;
}
CAdd(){
cout<<" Default Contructor"<<endl;
}
~CAdd(){
cout<<" Descontructor of programs" <<endl;
}
int add(){
return(one + one);
}
};
int main(){
CAdd myObj1(4);
CAdd myObj2;
cout<<"The value of Obj 1 : "<<myObj1.add()<<endl;
cout<<"Please enter value : ";
cin>>myObj2.one;
cout<<"The value of Obj 2 : "<<myObj2.add()<<endl;
getch();
return 0;
}

Code Example Constructor 1 in C++ Programming



#include<iostream>
#include<conio.h>
using namespace std;
class Example{
public:
int a,b;
public:
Example(){
a=10;
b=20;
}
void Display(){
cout<<"Value : "<<a<<"\t"<<"Value : "<<b<<endl;
}
};
int main(){
Example Obj;
Obj.Display();
getch();
return 0;
}

Book cpp_arrays


Book cpp_arrays is a book that a part of C++ programming .



Book C++ tutorial



Book C++ tutorial is a book for students that like programming in C++.

Copyright © 2014 IT Kampong Cham Email :eangkpc@gmail.com , Tell: 086 81 95 77.