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
List some basic data types in c?
write a program to copy the string using switch case?
Write a code to achieve inter processor communication (mutual exclusion implementation pseudo code)?
Why c language?
What is a pointer value and address in c?
What are the functions to open and close the file in c language?
write a C program: To recognize date of any format even formats like "feb-02-2003","02-february-2003",mm/dd/yy, dd/mm/yy and display it as mm/dd/yy.
When should you not use a type cast?
Is there a way to have non-constant case labels (i.e. Ranges or arbitrary expressions)?
Can the curly brackets { } be used to enclose a single line of code?
How arrays can be passed to a user defined function
Can we assign string to char pointer?
How can a string be converted to a number?
What is line in c preprocessor?
What is function in c with example?