National Computer Rank Examination Level 2 C Language Programming Design Review

Type:

Integer: int

Floating Point: float

Double Precision Floating Point: double

Character: char

Boolean: bool

Declaration:

auto (no need to specify)

static (initialized only once)

Format: static datatype var = value;

extern declares external variables (across files)

Format: extern int var;

register declares register variables (used sparingly to improve program execution speed, cannot perform address operations)

typedef defines type aliases

Format:

typedef struct type{

int var1;

char var2;

} type;

Invocation:

type a[3] = {{1,’c’},{2,’h’},{3,’i’}};

Reading:

Method One

a[0].var1

Method Two

type *ptr = a;

ptr[0] -> var1;

Leave a Comment