Professional Documents
Culture Documents
Computer Programming
Laboratory Session 09
IDE
http://www.codeblocks.org/
Pointers
Pointers are another important feature of the C
language.Pointers are useful due to following
reasons:
• They enable us to access a variable that is defined
outside a function.
• Pointers are more efficient in handling data tables and
sometimes even arrays.
• Pointers tend to reduce the length and complexity of a
program.
• They increase the execution speed.
• Use of pointers allows easy access to character strings.
Declaring Pointers
A pointer is declared using the indirection (*)
operator. The typical declaration of a pointer is:
datatype *pointername;
If a pointer “a” is pointing to an integer, it is
declared as:
int *a;
Pointers