Pointers in C basics 01

Preview:

Citation preview

02

5

24588

x

24588

Pointer variable

5

A

3.14

x

ch

y

Integer

Real

Character

Types of constant

Primary Constants Secondary Constants

Data Types

Numeric Non-NumericPointer

Array

Structure

Union

Integer Real Character

String

5

A

3.14

x

ch

y

Integer

Real

Character

Types of constant

Primary Constants Secondary Constants

Data Types

Numeric Non-NumericPointer

Array

Structure

Union

Integer Real Character

String

Data Type

Built – in Data Type

•int•float•char

Derived Data Type

•pointer

int *ptr;

* ptr

ptr is pointer variable

x

ptr

int x;

ptr = &x;&: Address Operator

ptr

float y;char ch;float *fptr;char *cptr;fptr = &y;cptr = &ch;

x

y

fptr

ch

cptr