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 |
/*program to calculate hra,da in salary if salary less than 10000 then hra15%,da13% otherwise hra20%,da18%/*
What is a class?
what is the output? #define fun(a,b,t) (g ##t=(a),(a)=(b),(b)=g##t) float gfloat; main() { float a=1.12,b=3.14; fun (a,b,float); printf("na=%4.2f,b=%4.2f",a,b); } A)Error in Defining Macro B)a=1.12,b=3.14 C)a=3.14,b=1.12 D)None of the Above
3 Answers Accenture, Infosys, Wipro,
Is stack a keyword in c?
Write a program which has the following seven functions. The functions should be: • main() this calls the other 6 functions • fget_long() a function which returns a long data type from a file • fget_short() a function which returns a short integer variable from a file • fget_float() a function which returns a floating point variable from a file • fprt_long() a function which prints its single, long argument into a file • fprt_short() a function which prints its single, short argument into a file • fprt_float() a function which prints its single, floating point argument into a file. You should use fscanf() to get the values of the variables from the input (the file) and fprintf() to print the values to the other file. Pay attention to using the correct format for each of the data types.
Write a code to reverse string seperated by spaces i/p str=India is my country o/p str=aidnI si ym yrtnuoc After writing code, optimize the code
How is a two dimensional array passed to function when the order of matrix is not known at complie time?
Why we write conio h in c?
Explain what header files do I need in order to define the standard library functions I use?
Please write me a program to print the first 50 prime numbers (NOT between the range 1 -50)
how does printf function work
what would be the output of the follwing struct st { char name[20]; int i; float f; }; main() { struct st emp = {"forum"}; printf("%d %f",emp.i,emp.f); }