FreePrograms

  CONTACT US   ABOUT US   PRIVACY  DISCLAIMER

C Language Tutorial with Free C Programs

FREE C PROGRAMS 

What is C C vs C++ vs Java Program Structure Data Types in C Basic Rules of C & C++
Functions in C If, Else Conditions Loops in C Switch Case Arrays
Pointers Structures in C Strings in C Command Line Arguments Type Casting
Linked Lists Recursion Binary Trees Inheritance Multiple Inheritance
Templates File I/O Object Oriented Programming Data Structures in C C interview Questions

Pointers in C : - C Programming Tutorial

A pointer is simply a memory address and its concept is easy to understand.

Let us declare a variable num

int num;

Now let us declare another variable num_ptr

int *num_ptr = &num

num_ptr is declared as a pointer to int. We have initialized it to point to num as shown above.

type * variable name 

Example:

int *ptr; 
float *string;

int * is the notation for a pointer to an int. & is the operator which returns the address of its argument.

The opposite operator, which gives the value at the end of the pointer is *.

 

© COPYRIGHT 2009 ALL RIGHTS RESERVED FREECPROGRAMS.COM