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 the difference between procedural and declarative language?
Explain the use of 'auto' keyword
What is meant by errors and debugging?
What is unary operator?
How to implement a packet in C
Differentiate between the expression “++a” and “a++”?
What is the benefit of using an enum rather than a #define constant?
what is the function of pragma directive in c?
while loop contains parts a) initialisation, evalution of an expression,increment /decrement b) initialisation, increment/decrement c) condition evalution d) none of the above
Explain can static variables be declared in a header file?
Why can’t we compare structures?
Explain the properties of union. What is the size of a union variable
Write a code to achieve inter processor communication (mutual exclusion implementation pseudo code)?
Explain what will the preprocessor do for a program?
Hi can anyone tell what is a start up code?