why we use pointer in c
Answers were Sorted based on User's Feedback
Answer / aravind
To pass the actual arguments by address instead by calling
by reference in function.
| Is This Answer Correct ? | 27 Yes | 2 No |
Answer / srinivas
the speed of execution will be increased because we
accessing address of the variable rather than variables
| Is This Answer Correct ? | 15 Yes | 1 No |
Answer / srinivash
to store the address of a variable which s effective in
fuction calling by call by reference r call by address method
| Is This Answer Correct ? | 14 Yes | 1 No |
Answer / nipa
using pointer some facility is there
1.. we reduce length and complexity of a program
2.. increase speed of execution of program
3.. it can capable to handling data table
4.. to access variable which is defined outside the function
5 .. handle character string
| Is This Answer Correct ? | 4 Yes | 2 No |
use of pointers makes the code more efficient and compact.
1.to acess array elements
2. to return more than one value to a function.
3. to acess dynamically allocated memory.
4. to implement data structures like linked lists,trees.
| Is This Answer Correct ? | 0 Yes | 1 No |
void main() { for(; 0 ;) ... { printf("hello"); ... } getch(); }
Give me the code of in-order recursive and non-recursive.
how to swap 2 numbers in a single statement?
I use turbo C which allocates 2 bytes for integers and 4 bytes for long. I tried to declare array of size 500000 of long type using the following code... long *arr; arr=(long *)(malloc)(500000 * sizeof(long)); It gives a warning that "Conversion may lose significant digits in function main"... And the resulting array size was very less around 8400 as compared to 500000. Any suggestions will be welcomed....
Write a program which calculate sum of several number and input it into an array. Then, the sum of all the number in the array is calculated.
c language interview questions & answer
Explain argument and its types.
Explain what is meant by high-order and low-order bytes?
What are the two types of functions in c?
why array index always starts from zero??
What is the output of the following program #include<stdio.h> main() { int i=0; fork(); printf("%d",i++); fork(); printf("%d",i++); fork(); wait(); }
main() { clrscr(); } clrscr();