• Skip to main content
  • Skip to primary sidebar
  • Skip to secondary sidebar
  • Skip to footer

Computer Notes

Library
    • Computer Fundamental
    • Computer Memory
    • DBMS Tutorial
    • Operating System
    • Computer Networking
    • C Programming
    • C++ Programming
    • Java Programming
    • C# Programming
    • SQL Tutorial
    • Management Tutorial
    • Computer Graphics
    • Compiler Design
    • Style Sheet
    • JavaScript Tutorial
    • Html Tutorial
    • Wordpress Tutorial
    • Python Tutorial
    • PHP Tutorial
    • JSP Tutorial
    • AngularJS Tutorial
    • Data Structures
    • E Commerce Tutorial
    • Visual Basic
    • Structs2 Tutorial
    • Digital Electronics
    • Internet Terms
    • Servlet Tutorial
    • Software Engineering
    • Interviews Questions
    • Basic Terms
    • Troubleshooting
Menu

Header Right

Home » C++ » C++ Programming

Memory Allocation in C++

By Dinesh Thakur

The Memory is allocated in two ways either in Static and either in Dynamic. In Static Memory Allocation the Size of Memory may be Fixed and pre-defined but the Limitation of Static Memory is that when a user Stores Large Amount of data or Large Number of Elements are Increased instead the Declarable size of Numbers So The Concept of Dynamic Memory Allocation is used When we doesn’t know about the actual size or when we doesn’t known about the Number of elements For this purpose we uses Dynamic Memory Allocation.

 

     There are Four different Memory Allocation Functions those are as Follows:-

 

1)   New :- This Function Allocates a Specified Number of bytes in a Memory. The Starting Address of Memory will be Returned when Address if Function Successfully Locates the Required number of bytes in Memory. But Always Remember that For Creating or Allocating the New Memory We must have to use the Pointer variable because the Pointer variable will Store the Address of Allocated Memory.

2)   Delete :- This Function is used for Deleting that Memory which is Consumed by the New Operator. We must have to specify the Name of Pointer variable because Memory is always consumed by the Pointer variable. When we specify the Name of Pointer variable then this will Automatically Detect the Address of Variable.

What is the Concepts in OOP’s? Benefits of OOPS

By Dinesh Thakur

A Language is called as OOP  Language if a Language Provides us the Following Concepts Are Five Concepts in OOP’s:-

1) Data Abstraction: – Data Abstraction is that in which A User Can use any of the data and Method from the Class Without knowing about how this is created So in other words we can say that A user can use all the Functions without Knowing about its detail For Example When a User gives Race to Car The Car will be Moved but a User doesn’t know how its Engine Will Work.

2) Inheritance:- Inheritance is very popular Concept in OOP’s This provides the Capability to a user to use the Predefined Code or the code that is not created by the user himself but if he may wants to use that code then he can use that code This is Called Inheritance but Always Remember in Inheritance a user only using the code but he will not be able to change the code that is previously created he can only use that code.

3) Data Encapsulation :- Data Encapsulation is also Known as Data Hiding as we know with the inheritance concept of OOP’s a  user can use any code that is previously created but  if a user wants to use that code then it is must thatpreviously code must be Public as the name suggests public means for other peoples but if a code is Private then it will be known as Encapsulate and user will not be able to use that code So With the help of OOP’s we can alter or change the code means we can make the Code as Private or public  This allows us to make our code either  as public or private

4) Polymorphism  :- Poly Means  many and morphism means many function The Concepts Introduces in the form of  Many behaviors of an object Like an Operator + is used for Addition of Two Numbers and + is also used for Joining two names The Polymorphism in C++ Introduces in the Form of Functions Overloading and  in the Form of Constructor Overloading

5) Dynamic Binding:- Binding is used when we call the Code of the Procedure in Binding all the Code that is Linked with the single procedure is Called When a Call is Made to that Procedure Then the Compiler will found the Entire code of the Single Procedure if A Compiler will Fond all the Code of Single Procedure in Compile Time then it is Called as the Early Binding Because Compiler Knows about the code at the time of Compilation but in the Late Binding Compiler will understand all the Code at  Run Time or at the Time of the Execution.

6) Message Communication: – Message Communication is occurred when an object passes the Call to Method of Class for Execution We Know for executing any method from the class First we have to create the object of class when an object passes References to function of class then In Message Communication First of all we have to Create the Object of the Class the we make Communication between the Object and the Methods of the Class.

Benefits of OOPS:-

OOP is used in Several Places the Features of the OOPS include

1. Inheritance: – We know that OOPS Provide Inheritance with the Help of the Inheritance The Code that is Previously Code  is used in many Places where we wants  By using the Inheritance We can Create our Programs by using pre-defined code.

2. In C++ we can write the  Code into the Classes So that it is called as OOP  Languages.

3. In the Classes we can create many Objects.

4. C++ is both Compiled and Interpreter Languages.

« Previous Page

Primary Sidebar

C++ Tutorials

C++ Tutorials

  • C++ - Data Types
  • C++ - Operators Types
  • C++ - CPP Program Structure
  • C++ - Conditional Statements
  • C++ - Loop
  • C++ - do-While Loop
  • C++ - Control Statements
  • C++ - Tokens
  • C++ - Jump Statements
  • C++ - Expressions
  • C++ - Constants
  • C++ - Character Set
  • C++ - Iteration Statements
  • C++ - I/O Statements
  • C++ - String
  • C++ - Manipulators

C++ Operator

  • C++ - Input/Output Operator
  • C++ - Operator Overloading

C++ Functions

  • C++ - Functions
  • C++ - Member Functions
  • C++ - Returning Object from Function
  • C++ - Call by Value Vs Reference
  • C++ - Friend Function
  • C++ - Virtual Function
  • C++ - Inline Function
  • C++ - Static Data Members
  • C++ - Static Member Functions

C++ Array & Pointer

  • C++ - Array
  • C++ - Array of Objects
  • C++ - Arrays as Class Members
  • C++ - Vector
  • C++ - Pointer
  • C++ - 'this' Pointer

C++ Classes & Objects

  • C++ - Class
  • C++ - Program Structure With Classes
  • C++ - OOP’s
  • C++ - Objects as Function Arguments
  • C++ - Procedure Vs OOL
  • C++ - Object Vs Class
  • C++ - Creating Objects
  • C++ - Constructors
  • C++ - Copy Constructor
  • C++ - Constructor Overloading
  • C++ - Destructor
  • C++ - Polymorphism
  • C++ - Virtual Base Class
  • C++ - Encapsulation

C++ Inheritance

  • C++ - Inheritance
  • C++ - Multiple Inheritance
  • C++ - Hybrid Inheritance
  • C++ - Abstraction
  • C++ - Overloading

C++ Exception Handling

  • C++ - Exception Handling
  • C++ - Templates
  • C++ - Standard Template Library

C++ Data Structure

  • C++ - Link List

C++ Programs

  • C++ Program for Electricity Bill
  • C++ Program for Multiply Matrices
  • C++ Program for Arithmetic Operators
  • C++ Program For Matrices
  • C++ Program for Constructor
  • C++ Program Verify Number
  • C++ Program Array Of Structure
  • C++ Program to find Average Marks
  • C++ Program Add And Subtract Matrices
  • C++ Program Menu Driven
  • C++ Program To Simple Interest
  • C++ Program To Find Average
  • C++ program exit()
  • C++ Program Using Array Of Objects
  • C++ Program Private Member Function
  • C++ Program To Reverse A String
  • C++ Program to Operator Overloading

Other Links

  • C++ - PDF Version

Footer

Basic Course

  • Computer Fundamental
  • Computer Networking
  • Operating System
  • Database System
  • Computer Graphics
  • Management System
  • Software Engineering
  • Digital Electronics
  • Electronic Commerce
  • Compiler Design
  • Troubleshooting

Programming

  • Java Programming
  • Structured Query (SQL)
  • C Programming
  • C++ Programming
  • Visual Basic
  • Data Structures
  • Struts 2
  • Java Servlet
  • C# Programming
  • Basic Terms
  • Interviews

World Wide Web

  • Internet
  • Java Script
  • HTML Language
  • Cascading Style Sheet
  • Java Server Pages
  • Wordpress
  • PHP
  • Python Tutorial
  • AngularJS
  • Troubleshooting

 About Us |  Contact Us |  FAQ

Dinesh Thakur is a Technology Columinist and founder of Computer Notes.

Copyright © 2025. All Rights Reserved.

APPLY FOR ONLINE JOB IN BIGGEST CRYPTO COMPANIES
APPLY NOW