Question

c++ I understand what a pointer is and what a double pointer is. However what I...

c++

I understand what a pointer is and what a double pointer is. However what I don't understand is why they are used. In which case should you use a pointer?

0 0
Add a comment Improve this question Transcribed image text
Answer #1

When you want to create the memory dynamically you have to use the pointeRS
We will use the pointers in functions where you want to return more than 1 value but you can

in those cases you will passes the parameters using the pointers
for implementing the most important data structures like linkedlist and trees we need to use pointers

Note : Please comment below if you have concerns. I am here to help you

If you like my answer please rate and help me it is very Imp for me

Add a comment
Know the answer?
Add Answer to:
c++ I understand what a pointer is and what a double pointer is. However what I...
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
  • Please give a specific example. I understand what the addition rule is, however I am having trouble coming up with a sit...

    Please give a specific example. I understand what the addition rule is, however I am having trouble coming up with a situation in which it would be used while providing calculations. Also, please do not write in cursive as it is difficult for me to read. THANK YOU! Describe a situation where you could use the addition rule to determine the probability of an outcome. Include an example of the calculations. (3 points)

  • I understand how to solve for A and F. However, I do not understand how to...

    I understand how to solve for A and F. However, I do not understand how to solve for B, C, D & E. Can you please show in detail how the fractions are solved step by step?

  • Why does Thevenin's Theorem work? I understand how to use it but I don't understand why...

    Why does Thevenin's Theorem work? I understand how to use it but I don't understand why it works. I have been reading my textbook and can follow the procedure, but I want to understand on a deeper level why the author does what they do. So far I know that the steps are 1. Find Vth, the open terminal voltage 2. Find isc, the short circuit current Vth 3. Rth isc But I don't know why these steps work. I...

  • I understand the core concepts of capacitors, however the idea of the switch isn't introduced very...

    I understand the core concepts of capacitors, however the idea of the switch isn't introduced very well in the book. I'm not sure how to approach this problem: if the switch isn't connected then the capacitors behave like they are in series, but I don't quite understand how there is a potential across an open circuit point "d " to "c".

  • Pointer (76%) Pointer is a (historical) concept used in C (and C++), but not in any...

    Pointer (76%) Pointer is a (historical) concept used in C (and C++), but not in any other computer languages. Due to C language’s being prevalent however, you need to learn about this. Pointer concept is explained in detail in the power point file of chapter 7 (slides 12, 20 etc. for example). 1. (12%) Printing a variable and its pointer. Consider the C instruction: int p = 0, *pptr = &p; Write a C program that prints the int variable...

  • Which of the following function pointer could be used to refer to the above function? double...

    Which of the following function pointer could be used to refer to the above function? double multiply Numbers (double a, int b) { double result = a*b; return result; } 4 Aint (*pt2Func)(int, int) = NULL; B. double (pt2Func)(double, int) = NULL; C. void *pt2Func)(double, int) = NULL; D. Both (B) & (C)

  • **C** Write a C function that inputs a pointer to a string and a pointer to...

    **C** Write a C function that inputs a pointer to a string and a pointer to a buffer. The function then scans through the string removing leading and trailing whitespace and replacing any run of whitespace within the string with a single space. Your function should follow this prototype: void tighten(char *oldstring, char* newstring, int length); The first argument is a pointer to a null-terminated string sitting somewhere in memory. The second argument is a pointer to the first char...

  • If void * is a pointer to void is a "generic" pointer type, and a void...

    If void * is a pointer to void is a "generic" pointer type, and a void * can be converted to any other pointer type * without an explicit cast, why in the ,myarrcopy function the malloc is created like char and not like void? if we are going to work with different type of arrays? Here is de program: *This is a function that make a copy of any given array. * We then use this function make a...

  • C++ Programme Write a function that receives, as arguments, a pointer to a double array, as...

    C++ Programme Write a function that receives, as arguments, a pointer to a double array, as well as the number of elements: in the array(int). The function must use pointer operations and calculate the standard deviation of the elements in the array. The function returns the standard deviation to the calling statementſ Use the function in main( to display its operation. | Example: array = (11.2, 2.4, 3.13, 16.4, 5.8, 9.22, 4.9, 10.5, 6.5, 2.99) std Dev(array) = 4.249367 ZWI...

  • IMPORTANT: I don't need help with "a". However, I do need help with b&c IMPORTANT: I...

    IMPORTANT: I don't need help with "a". However, I do need help with b&c IMPORTANT: I understand that there's a walkthrough given bellow. However, I do not understand the walkthrough given for b&c. Part B - Why does E(x)+E(y)=2u (2 mew)? -What is this?: I honestly have no idea what it is. Please explain to me what it is and what its significance is within the problem. -This may be the same thing as the symbol above, but just in...

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
ADVERTISEMENT