Define the types of the expressions

Assignment Help Computer Engineering
Reference no: EM1331572

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: EM1331572

Questions Cloud

Show the command line and accept one interger as input : Call a function the outputs seven sequential intergers, with input interger as the middle item on the command line below the input prompt.
How retail trends affected consumer behavior : How have retail trends affected consumer behavior? How have consumers affected the retail industry? Which carries more influence over the other? Why?
Illustrate what value for r is optimal for the seller : Illustrate what value for r is optimal for the seller, and what then is the seller's expected profit.
Risks associated in employee engagement : Risks associated in Employee Engagement - What staffing factors (teamwork, hiring decisions, retooling of current employees, et cetera) needed to be considered?
Define the types of the expressions : Using no other objects besides those already declared, how may you alter ptrPtr so that is points to a pointer to b without directly touching ptr?
A reasonable accommodation : What would be a reasonable accommodation that an employer could make to satisfy both the Christian and non-Christian employees?
At which point do you reach equilibrium : At which point do you reach equilibrium. Also explain why is that considered equilibrium.
Who approves and rejects resources : Who approves and rejects changes to the scope of the project and Who approves and rejects resources
Common runtime libraries such as visual studio.net : should C++ programming language be extended to contain an XML editor and parser as is the case for the Java® programming language, or should this be built into the Integrated Development Environment (IDE) that supports the programming language?

Reviews

Write a Review

Computer Engineering Questions & Answers

  Make short story consisting of several of these sentences

Write down an application that uses random-number generation to create sentences. Use four arrays of strings called article, noun, verb and preposition.

  What is an information system

What is an information system and why are they important? Can u please give me some examples. I am totally clueless on this subject. Is it possible to use information technology to gain a competitive advantage.

  Wireless networking

Explain the origins/genesis of the wireless networking. Explain the devices included used and how they operate.

  Security devices for protection against different attack

Describe two or more attacks for which the routers (layer 3 devices) are vulnerable. Explain how these attacks are detected and prevented by the security devices.

  Prepare an analysis discussing the factors

While there is backward compatibility between the various versions of the software, the older versions do not have all of the "bells and whistles" of the newer versions.

  Define role of customer and end-user on an agile process

Define role of customer and end-user on an agile process

  Ssl protection

Explain whether pages are served over the SSL protected from problem you explained. If so, explain why; if not, explain why not.

  What do you mean by the concept of "code reuse"

What is meant by the concept of "code reuse"? consider some possible ways in which code may be reused. Do you think this concept is an important one.

  Addressing and naming model

Sketch a plan for development of the addressing and the naming model in an environment of following given scenario: Ten (10) departments in the 1,000-employee organization. Equal separation by geography

  Computing roots of the function f

The best known iterative method in order compute the roots of the function f (that is, the x-values for which f(x) is 0) is Newton-Raphson approximation.

  Create a program that displays all of numbers in the file

Create a program that displays all of numbers in the file

  How to handle performance deterioration in wlan

South West State University installed a series of 4 Wi-Fi omni-directional APs (access points) spread across the ceiling of the key floor of their library.

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