what is pointer ? what is the use of pointer?
Answer Posted / gouse mohiddin
A Pointer is a variable which holds the memory address of
the another variable
pointers are used to save and find the memory address of
the another variable.
The syntax is as shown below. You start by specifying the
type of data stored in the location identified by the
pointer. The asterisk tells the compiler that you are
creating a pointer variable. Finally you give the name of
the variable.
type * variable name
Example:
int *ptr;
float *string;
Address operator:
Once we declare a pointer variable we must point it to
something we can do this by assigning to the pointer the
address of the variable you want to point as in the
following example:
ptr=#
This places the address where num is stores into the
variable ptr. If num is stored in memory 21260 address then
the variable ptr has the value 21260.
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What is array in c with example?
please send me the code for multiplying sparse matrix using c
What does a pointer variable always consist of?
A collection of functions,calls,subroutines or other data a) library b) header files c) set of files d) textfiles
Explain how do you determine a file’s attributes?
hello freinds next week my interview in reliance,nybody has an idea about it intervew questions..so tell
What are the loops in c?
Is c easy to learn?
What is the difference between array_name and &array_name?
find the output? void r(int a[],int c, int n) { if(c>n) { a[c]=a[c]+c; r(a,++c,n); r(a,++c,n); } } int main() { int i,a[5]={0}; r(a,0,5); for(i=0;i<5;i++) printf("\n %d",a[i]); getch(); }
Do pointers need to be initialized?
What is the scope of local variable in c?
What are the features of c languages?
Why main function is special give two reasons?
Create a simple code fragment that will swap the values of two variables num1 and num2.