Skip to content

Instantly share code, notes, and snippets.

View dibakarsutradhar's full-sized avatar
👾
Powered by Coffee

Dibakar dibakarsutradhar

👾
Powered by Coffee
View GitHub Profile
#include <bits/stdc++.h>
using namespace std;
// Base Class
class Parent {
public:
void print(){
cout << "Parent Print Function" << endl;
}
#include <iostream>
using namespace std;
class Complex{
private:
int real, imag; // imag for imagination
public:
Complex(int r = 0, int i = 0) {real = r; imag = i;}
#include <iostream>
using namespace std;
class Numbers {
public:
// function with int parameter
void num(int x){
cout << "Value of x is: "<< x << endl;
#include <iostream>
using namespace std;
class printInfo {
public:
void print(int i){
cout << "Int: " << i << endl;
}
// C++ Inheritance
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
// Base Class
class Parent{
public:
// c++ oop protected access modifier
#include <iostream>
using namespace std;
// defining a class
class Parent {
protected: // we defined that this class data members will be protected
int number_protected;
// c++ oop private access modifier
#include <iostream>
using namespace std;
// defining a class
class Circle {
private: // we defined that this class data members will be private
double radius;
@dibakarsutradhar
dibakarsutradhar / private1.cpp
Created September 3, 2018 06:39
It's a wrong code
// c++ oop private access modifier
#include <iostream>
using namespace std;
// defining a class
class Circle {
private: // we defined that this class data members will be private
double radius;
// c++ oop public access modifier
#include <iostream>
using namespace std;
// defining a class
class Circle {
public: // we defined that this class data members will be public
double radius;
#include <iostream>
#include <string>
using namespace std;
class CarMake {
public:
string m_make;
string m_model;
int m_year;