Starting Out With C++: Early Objects, Student Value Edition (9th Edition)
Starting Out With C++: Early Objects, Student Value Edition (9th Edition)
9th Edition
ISBN: 9780134379319
Author: Tony Gaddis, Judy Walters, Godfrey Muganda
Publisher: PEARSON
bartleby

Concept explainers

Question
Book Icon
Chapter 10.12, Problem 10.20CP
Program Plan Intro

Pointer:

Pointer is a special type of variable to store the address of the memory location, which can be accessed later.

  • If an asterisk “*” operator is present before the variable, then that variable is referred as pointer variable.
    • It is also called as dereferencing or indirection operator.
  • Pointer is just a type of variable that stores the addresses of other variables.
  • Using pointers, the address of a variable can be accessed and the data stored in that variable can be retrieved.

Syntax of pointer variable declaration:

<variable-type> *<variable-name>;

Usage of pointers to structures:

The usage of pointers to structure is same as declaring a pointer variable.

Blurred answer
Students have asked these similar questions
( In c++and oop ) without using vectors or data structure . Create a class IntegerSet for which each object can hold integers in the range 0 through 100. A set is represented internally as an array of ones and zeros. Array element a[ i ] is 1 if integer i is in the set. Array element a[ j ] is 0 if integer j is not in the set. • The default constructor initializes a set to the so-called “empty set,” i.e., a set whose array representation contains all zeros. • Provide member functions for the common set operations. For example, provide a unionOfSets member function that creates a third set that is the settheoretic union of two existing sets (i.e., an element of the third set’s array is set to 1 if that element is 1 in either or both of the existing sets, and an element of the third set’s array is set to 0 if that element is 0 in each of the existingsets). Provide an intersectionOfSets member function which creates a third set which is the set theoretic intersection of two existing sets…
Implement in C Programming 7.9.1: LAB: BankAccount struct Given main(), build a struct called BankAccount that manages checking and savings accounts. The struct has three data members: a customer name (string), the customer's savings account balance (double), and the customer's checking account balance (double). Assume customer name has a maximum length of 20. Implement the BankAccount struct and related function declarations in BankAccount.h, and implement the related function definitions in BankAccount.c as listed below: BankAccount InitBankAccount(char* newName, double amt1, double amt2) - set the customer name to parameter newName, set the checking account balance to parameter amt1 and set the savings account balance to parameter amt2. (amt stands for amount) BankAccount SetName(char* newName, BankAccount account) - set the customer name void GetName(char* customerName, BankAccount account) - return the customer name in customerName BankAccount SetChecking(double amt, BankAccount…
11.7: Customer AccountsWrite a program that uses a structure to store the following data about a customer account:     Customer name     Customer address     City     State     ZIP code     Telephone     Account balance     Date of last payment The program should use an array of at least 20 structures. It should let the user enter data into the array, change the contents of any element, and display all the data stored in the array. The program should have a menu-driven user interface. Prompts And Output Labels. Your main menu should be the following:     1. Enter new account information     2. Change account information     3. Display all account information     4. Exit the programThe user is expected to enter 1 or 2 or 3 or 4.The main menu is displayed at the start of the program and after the handling of choices 1, 2 and 3.If 1 is entered for the main menu, the program prompts for each of the data listed above, in the order listed above, using the above data descriptions (e.g. "ZIP…

Chapter 10 Solutions

Starting Out With C++: Early Objects, Student Value Edition (9th Edition)

Ch. 10.10 - Complete the following program skeleton. When...Ch. 10.10 - Look at the following array definition: const int...Ch. 10.10 - Assume ip is a pointer to an int. Write a...Ch. 10.10 - Assume ip is a pointer to an int. Write a...Ch. 10.10 - Prob. 10.15CPCh. 10.10 - Prob. 10.16CPCh. 10.10 - Prob. 10.17CPCh. 10.12 - Prob. 10.18CPCh. 10.12 - Assume the following structure declaration exists...Ch. 10.12 - Prob. 10.20CPCh. 10 - Each byte in memory is assigned a unique _____Ch. 10 - The _____ operator can be used to determine a...Ch. 10 - Prob. 3RQECh. 10 - The _____ operator can be used to work with the...Ch. 10 - Prob. 5RQECh. 10 - Creating variables while a program is running is...Ch. 10 - Prob. 7RQECh. 10 - If the new operator cannot allocate the amount of...Ch. 10 - Prob. 9RQECh. 10 - When a program is finished with a chunk of...Ch. 10 - You should only use the delete operator to...Ch. 10 - What does the indirection operator do?Ch. 10 - Look at the following code. int X = 7; int ptr =...Ch. 10 - Name two different uses for the C++ operator.Ch. 10 - Prob. 15RQECh. 10 - Prob. 16RQECh. 10 - Prob. 17RQECh. 10 - What is the purpose of the new operator?Ch. 10 - What happens when a program uses the new operator...Ch. 10 - Prob. 20RQECh. 10 - Prob. 21RQECh. 10 - Prob. 22RQECh. 10 - Prob. 23RQECh. 10 - Prob. 24RQECh. 10 - Prob. 25RQECh. 10 - Prob. 26RQECh. 10 - What happens when a unique_ptr that is managing an...Ch. 10 - What does the get ( ) method of the unique_ptr...Ch. 10 - Prob. 29RQECh. 10 - Prob. 30RQECh. 10 - Prob. 31RQECh. 10 - Prob. 32RQECh. 10 - Consider the function void change(int p) { P = 20;...Ch. 10 - Prob. 34RQECh. 10 - Write a function whose prototype is void...Ch. 10 - Write a function void switchEnds(int array, int...Ch. 10 - Given the variable initializations int a[5] = {0,...Ch. 10 - Each of the following declarations and program...Ch. 10 - Prob. 39RQECh. 10 - Test Scores #1 Write a program that dynamically...Ch. 10 - Test Scores #2 Modify the program of Programming...Ch. 10 - Indirect Sorting Through Pointers #1 Consider a...Ch. 10 - Indirect Sorting Through Pointers #2 Write a...Ch. 10 - Pie a la Mode In statistics the mode of a set of...Ch. 10 - Median Function In statistics the median of a set...Ch. 10 - Movie Statistics Write a program that can be used...Ch. 10 - Days in Current Month Write a program that can...Ch. 10 - Age Write a program that asks for the users name...Ch. 10 - Prob. 10PC
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
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr