C++ Codes
Algorithms
Algorithm Analysis in C++
Beginners
Code Snippets
Graphics
Data Structures
File Manipulation
Games
Mathematics
Miscellaneous
Visual C++ Library
C++ > Beginners Lab Assignments sample source codes
Class that imitates the functionality of the basic data type
Class that imitates the functionality of the basic data type # include
#include
class Int { int var; public : /* Here we try to overcome the problem of carbage value by initializing the value by 0 */ Int() { var =0; } // Overloaded Constructor Int(int a ) { var = a; } int add( Int b) // Note : Int , not int { var+=b.var; /* For ex. if the user enters a.add(b); then result will be a = a + b; */ return(var); } void disp() //again, Int { cout<
Privacy Policy
|
Link to Us
|
Links