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

Write a C program on Centralized OLTP, Decentralized OLTP using locking mechanism, Semaphore using locking mechanism, Shared memory, message queues, channel of communication, sockets and a simple program on Saving bank application program using OLTP in IPC?

2426


What header files do I need in order to define the standard library functions I use?

755


What is the purpose of realloc()?

881


Explain the difference between structs and unions in c?

766


In which header file is the null macro defined?

1112


how to make a scientific calculater ?

1799


Can we replace the struct function in tree syntax with a union?

1012


Is main is user defined function?

861


What is use of #include in c?

827


What is wrong with this program statement?

784


How do you print an address?

984


What are formal parameters?

854


What are the different types of objects used in c?

750


What is a c token and types of c tokens?

819


What is a program flowchart?

819