What are the values of *ptr and **ptrptr

Assignment Help C/C++ Programming
Reference no: EM13936928

1. Consider

int a, b;

int *prt; //A pointer
int **prtPrt //A pointer to a pointer

ptr = &a;
prtPtr = &ptr;

a. Is this code legal?

b. What are the values of *ptr and **ptrPtr?

c. Using no other objects besides those already declared, how can you alter ptrPtr so that is points to a pointer to b without

directly touching ptr?

d. Is the following statement legal?

2.
a. ls *&x always equal to x? If not, give an example

b. ls &*x always equal to x? Uf not, give an example

3. For the declarations
int a = 5;

int *ptr - &a;

what are the values of the following?
a. ptr
b. *ptr
c. ptr == a
d. ptr == &a
e. &ptr
f. *a
g. *&a
h. **&ptr

4. Give the typr of each identifier declared here and the types of the expressions. Is any expression illegal?

a. struct X { inta; S *b; };
b. S z;
c. S *x;
d. x->a
e. x->b
f. z.b
g. z.a
h. *z.a
j. (*z).a
k. x->b-z.b
l. &z
m. &x

5. Is the following code legal? Why or why not?

int a = a;
const in & b = a;

6. What is worng with omitting a space in *x/*y?

Reference no: EM13936928

Questions Cloud

Discuss the effects that an impending labor shortage : Discuss the effects that an impending labor shortage might have on the following three sub-functions of human resource management: selection and placement, training and career development, and compensation and benefits. Which sub-function might be mo..
How did the work of mary leakey contribute to our knowledge : Write a one-page paper, How did the work of Mary Leakey contribute to our knowledge of early hominids and an understanding of human evolution?
Bolstering consumer confidence : Discuss and describe three strategies that you think would be effective in bolstering consumer confidence or to take advantage of current consumer behavior trends.
Campus ipv4 redesign project : Introduction and background to the problem: (most of it was supplied by the client; you may need to capture the ideas and elaborate it) b. Introduction about the project members and their role/contributions
What are the values of *ptr and **ptrptr : Using no other objects besides those already declared, how can you alter ptrPtr so that is points to a pointer to b withoutdirectly touching ptr?
Product or a service with some possible issues : I've choose a company -ASoS (clothing company) need to come up with a new product or a service and come up with some possible issues with it and do customer interview (4 interviews) and give solutions to it with recommendation.
What do report indicate about the plants quality performance : What do the reports indicate about the plant's quality performance? Calculate the ratio of each costs of quality category (prevention, appraisal, internal failure and external failure) to sales in 2006 and 2007.
Web about toutorial for cooking saudi food : Will develop a web about toutorial for cooking Saudi food , and have a hard time writing a planing project for my topic. Follow these link in order to complete the assignment Her is the requirements for the assignment This assignment has two part..
Difference between reproductive and therapeutic cloning : What is the difference between reproductive and therapeutic cloning? Name one limitation for each technique. Make sure to differentiate between pluripotent and totipotent embryonic stem cells as well as adult and embryonic stem cells.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd