Question

Im new to pointers in c++, need some help with this problem 1) If i is...

Im new to pointers in c++, need some help with this problem

1) If i is an integer and p and q are pointers to integers, which of the following assignments
cause a compilation error, and if they do why?
a. p = &i;             e. i = *&p;   i. q = **&p;
b. p = *&i;           f. i = &*p;     j. q = *&p;
c. p = &*i;          g. p = &*&i;    k. q = &*p;
d. i = *&*p;        h. q = *&*p;


0 0
Add a comment Improve this question Transcribed image text
Know the answer?
Add Answer to:
Im new to pointers in c++, need some help with this problem 1) If i is...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Hi all, I need help to do a project based on C++ smart pointers. I have...

    Hi all, I need help to do a project based on C++ smart pointers. I have to implement the class template my_unique_ptr which is a pointer management class template. Also, it's required to implement the following public methods: a. Default constructor that initializes the object to point to nullptr. b. Constructor that takes a pointer Type * as a parameter and sets the object to point there. We say that the newly created object takes ownership of the pointed memory....

  • I need help on parts e-f 4. Suppose that P{X = i, Y = j} =...

    I need help on parts e-f 4. Suppose that P{X = i, Y = j} = c(i+j) for nonnegative integers i and j with i+j < 3; otherwise, the probability is zero. (a) Determine c. (b) Compute the marginal p.m.f. of X. (c) Compute the marginal p.m.f. of Y. (d) Are X and Y be independent? (e) Compute P(X+Y < 2). (f) Compute E[XY). (g) Compute E[X] and E[Y). (h) Compute E[X+Y).

  • I need some help with this accouting problem. S2-2 Identifying increases and decreases in accounts For...

    I need some help with this accouting problem. S2-2 Identifying increases and decreases in accounts For cach account, identify whether the changes would be recorded as a debit (DR) or credit (CR). f. Decrease to Prepaid Rent a. Increase to Accounts Receivable g. Increase to Common Stock b. Decrease to Unearned Revenue h. Increase to Notes Receivable c. Decrease to Cash i. Decrease to Accounts Payable d. Increase to Interest Expense j. Increase to Interest Revenue e. Increase to Salaries...

  • I need some help with this problem, please. Problem 1 Consider the points P = (01,02)...

    I need some help with this problem, please. Problem 1 Consider the points P = (01,02) and Q = (U1, U2), and assume that none of 01, 02, u and uz is zero. (a) Find the slope my through O and P and the slope m2 through O and Q. (b) Let T O P, 7=and let 7.7 denote their inner product. Show that mim2 = -1 if and only if 7.7 = 0. (c) Use part (b) to explain...

  • Working with pointers in C++. I need a brief step by step explanation of the code...

    Working with pointers in C++. I need a brief step by step explanation of the code to help me understand why the output is: 5 4 3 2 1 What will be displayed? Explain each step of the code and the related use of pointers. #include <iostream> using namespace std; int* myfun(int*); int main() {    int x[5] = { 1, 2, 3, 4, 5 };    int i, *p;    p = myfun(x);    for (i = 0; i < 5; i++)        ...

  • I need help with parts H, I, and J only please Part II Monopoly P ATC...

    I need help with parts H, I, and J only please Part II Monopoly P ATC 20 MC 17 15 13 9 6 D 0 40 50 55 90 Q MR A) What is the profit maximizing output level for this monopolist? B) What is the profit maximizing price this monopolist will charge? C) The total revenue of this monopolist is equal to? D) What is the ATC of this monopolist when it maximizes its profit? E) What is the...

  •       -       A.       B.       C.       D.       E.       F.       G.       H.       I.       J.       K.     ...

          -       A.       B.       C.       D.       E.       F.       G.       H.       I.       J.       K.       L.       M.       N.       O.    Telecommuting       -       A.       B.       C.       D.       E.       F.       G.       H.       I.       J.       K.       L.       M.       N.       O.    Change       -       A.       B.       C.       D.       E.       F.       G.       H.       I.       J.       K.       L.       M.       N.       O.    Job Sharing       -       A.       B.       C.       D.       E.       F.       G.       H.       I.       J.       K.       L.       M.       N.       O.    Job Redesign       -       A.       B.       C.       D.       E.       F.       G.       H.       I.      ...

  • why is this wrong for vectors vector<char> decrypt{ {'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',...

    why is this wrong for vectors vector<char> decrypt{ {'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A'}, {'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B'}, }; for(int...

  • I NEED A MATHEMATICAL ALGORITHM FOR A CEASER CHYPER I CREATED. PLEASE HELP ME...THANK YOU! THE...

    I NEED A MATHEMATICAL ALGORITHM FOR A CEASER CHYPER I CREATED. PLEASE HELP ME...THANK YOU! THE SINGLE-DIGIT KEY IS 14 THE PHRASE IS "GOOD MORNING PROFESSOR" THE CYPHER IS UCCR ACFBWBU DFCTSGGCF I DON'T KNOW HOW TO CREATE THE ALGORITHM AND IT CANNOT BE COMPUTER GENERATED. a. Develop a Caesar cipher-type encryption algorithm with a little more complexity in it. For example, the algorithm could alternatively shift the cleartext letters positive and negative by the amount of the key value....

  • Help in 12 , I need help on how to do the steps for this problem...

    Help in 12 , I need help on how to do the steps for this problem A) -1 B) 0 E) -2 12. Using the table of average bond energies below, the AH for the reaction is k.J H_CzC-H (g) + H-1 (g) → H2C CHI (g) Bond: C C C-C H-I C-I CH 0 2 D (kJ/mol): 839 614 299 240 413 A) +506 B)-931, C)-506 C (1 E) +129

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT