0sually only the first 12 characters are significant
There can "e no em"edded "lan3s
4eywords cannot "e used as identifiers
Identifiers are case sensitive
Identifiers refer to the names of data types! constants! varia"les! and functions
Two )lassifications of Data Types
5uilt*in data types
/undamental data types &int, char, double, float,
void, pointer'
Derived data types &array! string! structure'
Programmer*defined data types
Structure
0nion
6numeration
/undamental Data Types
void used to denote the type with no values
int used to denote an integer type
char used to denote a character type
float, double used to denote a floating
point type
int *! float *! char 7 used to denote a
pointer type! which is a memory address type
0ses of /undamental Data Types int elevationIndicator; char inputSymbol; float totalCost; int main (void) { double grossroduct; int *temperature!aluetr; grossroduct " #$%&'(); inputSymbol " *a*; return (+); , -- .nd main
Derived Data Types
Array a finite seuence &or ta"le' of
varia"les of the same data type
String an array of character varia"les
Structure a collection of related varia"les
of the same and8or different data types9 The structure is called a record and the varia"les in the record are called mem"ers or fields
0ses of Derived Data Types int elevation/able01+2; char inputSymbols02 " 34ello 5orld3; struct operationsStruct { double heat6eading; int temperature!alue; float speed7eter; char actionCode; ,; -- .nd struct struct operationsStruct current8perations;
Records &Structures'
# record permits a programmer to handle a group
of varia"les as one varia"le
The fields &mem"ers' of a record can "e any "uilt*
in or programmer*defined data type
# record can have values assigned to and read
from it :ust li3e the "uilt*in varia"le types
# record can also "e passed as an argument to a
function and serve as the return value for a function
The typedef 4eyword and Records The typedef 3eyword can "e used to create a synonym for a data type9 It is most often used to simplify the naming and use of record types &i9e9! structure types'9 typedef struct { double heat6eading; int temperature!alue; float speed7eter; char actionCode; , operations6ecord/ype; operations6ecord/ype current8perations; operations6ecord/ype future8perations;