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
Why do we use pointer to pointer in c?
What 'lex' does?
What does stand for?
There seem to be a few missing operators ..
What are type modifiers in c?
write a program that will open the file, count the number of occurences of each word in the the complete works of shakespeare. You will then tabulate this information in another file.
When should structures be passed by values or by references?
why programs in c are running with out #include
write an algorithm to display a square matrix.
int i=10; printf("%d %d %d", i, i=20, i);
What is d'n in c?
Why structure is used in c?
How many header files are in c?
we called a function and passed something do it we have always passed the "values" of variables to the called function. such functions calles are called a) calls by reference b) calls by value c) calls by zero d) none of the above
void main(){ int a; a=1; while(a-->=1) while(a-->=0); printf("%d",a); }