Problem Solving With C++ (Looseleaf) - With Access
Problem Solving With C++ (Looseleaf) - With Access
9th Edition
ISBN: 9780133835267
Author: SAVITCH
Publisher: PEARSON
bartleby

Concept explainers

Question
Book Icon
Chapter 9.2, Problem 11STE
Program Plan Intro

Pointer in C++:

A pointer is a variable whose value will be another variable’s address. Generally, a pointer variable is declared as follows:

type *var-name;

Here, “type” is the pointer’s base type and “var-name” is the pointer variable name. The asterisk is used to designate a variable as a pointer.

The delete operator:

The delete operator is used to destruct the object that is created with new by deallocating the memory associated with the object.

The syntax of delete operator is as follows:

[] delete cast-expression

[] delete[] cast-expression

In the above statement, the “cast-expression” argument must be a pointer to a block of memory previously allocated for an object created with the new operator.

Given code:

The following code is used to create a dynamic array.

int *entry; //Initialise pointer

entry = new int[10]; //create a dynamic array

Blurred answer
Students have asked these similar questions
Write a script that will display the element of a single dimensional array of numbers in reverseby using pointers.a) The user should be prompted to make a decision on the size of the array.b) The user should also be prompted to type in the individual element of thearray in order.c) Use Pointers!  C LANGUAGE PLEASE
Write a single line of code that will accomplish the following:   declare arr to be of type "pointer to a char" allocate a dynamic array of type char with capacity 4 assign the starting address of the array to arr HINT: Use conventional spacing (one space each side of the = operator) and don't forget your semicolon.
Computer Science Write a shell program to demonstrate array operations using switch case. The operations are print all values of an array, print specific values of an array, print range values, get the size of an array, search and replace value, add new value to existing array, remove a value of an array, deleting Arrays, copy an array, combining arrays, and load Content of a File into an array
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education