myCompiler
English
Deutsch
English
Español
Français
Italiano
日本語
한국어
Nederlands
Polski
Português
Recent
Login
Sign up
Deutsch
English
Español
Français
Italiano
日本語
한국어
Nederlands
Polski
Português
Recent
Login
Sign up
A
@Adarsh1999
Inheritance
C++
3 years ago
/* mom and daughter some properties of mom inherited to daughter Inheritance In C++, it is possible to inherit attributes and methods from one class to another. We group the "inheritance concept" into two categories: derived class (child) - the cl
Encapsulation
C++
3 years ago
/* school bag can keep books, pen eraser ,sharpner etc hidden in bag Encapsulation The meaning of Encapsulation, is to make sure that "sensitive" data is hidden from users. To achieve this, you must declare class variables/attributes as private (c
Access Specifiers
C++
3 years ago
/* The public keyword is an access specifier. Access specifiers define how the members (attributes and methods) of a class can be accessed. In the example above, the members are public - which means that they can be accessed and modified from
Constructors
C++
3 years ago
class Car { // The class public: // Access specifier string brand; // Attribute string model; // Attribute int year; // Attribute Car(string x, string y, int z); // Constructor declaration }; // Cons
Class Methods
C++
3 years ago
#include<iostream> #include<string> using namespace std; #if 0 // Inside Example class car{ public: void name(){ cout<<"This is volvo car";
classes and objects
C++
3 years ago
//https://www.w3schools.com/cpp/cpp_oop.asp /* class : car data members : color,weight,speed,model methods : startcar(),break(),change gear(),speedup() */ #include<iostream>
only difference in c and c++ without oops
C++
3 years ago
/* https://www.w3schools.com/cpp/ https://www.geeksforgeeks.org/difference-between-c-and-c/ */ #include<iostream> #include<string> using namespace std;
Previous
Next page