When can you use a pointer with a function?



When can you use a pointer with a function?..

Answer / Neeraj Trivedi

"A pointer can be used with a function to allow the function to modify its caller's variables, or to pass large blocks of data (such as arrays and structures) to functions more efficiently. Pointers are particularly useful when working with dynamic memory allocation or in situations where you want to iterate through an array or traverse a data structure like a linked list. "

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Interview Questions

write a program that declares an array of 30 elements named "income" in the main functions. then cal and pass the array to a programmer-defined function named "getIncome" within the "getIncome" function, ask the user for annual income of 30 employees. then calculate and print total income on the screen using the following function: "void getIncome ( ai []);

1 Answers   TCS,


what is the difference between char * const and const char *?

2 Answers   TCS,


Explain what is meant by 'bit masking'?

1 Answers  


How does the C program handle segmentation faults?

2 Answers  


What are the header files used in c language?

1 Answers  


What is a loop?

1 Answers  


Who developed c language?

1 Answers  


Under what circumstances does a name clash occur?

1 Answers   InterGraph,


What is function pointer c?

1 Answers  


int a=2,b=3,c=4; printf("a=%d,b=%d\n",a,b,c); what is the o/p?

6 Answers   Verifone,


What are function pointers? Provide an example.

1 Answers  


What is the use of getch ()?

1 Answers  


Categories