Powered By Blogger

Friday 11 January 2013

How to Define Data Types?

The Syntax for Defining a Data type is:
<Data Type> <Variable Name> , . . . . . . ;
Declaration is done at the beginning of function :


Data Definition

Data type

Memory Defined

Size (bytes)

Value Assigned

char a, c;

char

a

c

1

1

-

-

char a=’Z’

char

a

1

Z

int a;

int

a

4

-

int a = 2;

int

a

4

2

float a;

float

a

4

-

float a = 2.3;

float

a

4

2.3

 So, this is how you declare & define data types in your C program.

 

 
 

No comments:

Post a Comment