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

  Program that is supposed to search message.txt and print out

I'm having trouble with a program that is supposed to search message.txt and print out the message. i will upload instructions. We must use functions, and we were not instructed on how to search char arrays for this purpose and I am lost. Your hel..

  Write a function that compares at most n bytes

Write the following function that compares at most n bytes beginning with s2 with the cor- responding bytes beginning with s1, where n is the number of bytes that s2 has to be incremented before it points to the null character \0.

  The westfield carpet company has asked you to write an

the westfield carpet company has asked you to write an application that calculates the price of carpeting for

  Write a function called distance

Write a function called distance that takes two Points as arguments and returns the distance between them.

  Determines the access privillege of a derived class

The base class access specifier determines the access privillege of a derived class to its base class

  We base our need to implement composition upon

What criterion, or criteria, should be used to include objects of a class as data members of another class? In other words, what should we base our need to implement composition upon?

  Definition of two queues

Write a code in C language for the definition of two queues, one to hold the process in ready state and one to hold the process in waiting state.

  Calculate the trajectory of a soccer ball

Write a program to calculate the trajectory (flight path) of a soccer ball

  In psuedocode, design an application

In psuedocode, design an application that has an array of at least 20 integers. It should call a module that uses the sequential search algorithm to locate one of the values

  Write a main function to test the class employee

Define an Employee class. Add the following private date members to the class: string status, int dependents. Status represents the marital status of the employee and should be set to either "m" or "s".

  Write a number guessing game in which the computer selects

Write a number guessing game in which the computer selects a random number in the range of 0 to 100, and users get a maximum of 20 attempts to guess it.

  C++ program that prompts the user to enter a length in feet

If the user enters a negative number or a non-digit number, throw and handle an appropriate exception and prompt the user to enter another set of numbers.

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