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


Please Help Members By Posting Answers For Below Questions

Why do we use pointer to pointer in c?

588


What 'lex' does?

710


What does stand for?

587


There seem to be a few missing operators ..

611


What are type modifiers in c?

615






 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.

1722


When should structures be passed by values or by references?

575


why programs in c are running with out #include? some warnings are display in terminal but we execute the program we get answer why? eg: main() { printf("hello world "); }

1314


write an algorithm to display a square matrix.

2216


int i=10; printf("%d %d %d", i, i=20, i);

1004


What is d'n in c?

624


Why structure is used in c?

578


How many header files are in c?

547


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

629


void main(){ int a; a=1; while(a-->=1) while(a-->=0); printf("%d",a); }

1249