7.3
How the Tutorial Program Works
The first part of the program includes a series of header files:
#include
"machine.h"
#include
"string.h"
The program then gives prototypes for the constants, structures, and function initial values:
#define NAME (short)0
#define AGE (short)1
#define ID (short)2
#define LENGTH 8
struct namelist {
char name[LENGTH];
short age;
long idcode;
};
struct namelist section1[] = {
"Naoko", 17, 1234,
"Midori",
22,
8888,
"Rie", 19, 7777,
"Eri", 20, 9999,
"Kyoko", 26, 3333,
"", 0, 0
};
int
count;
void
sort();
Now the main program.
main( )
{
count = 0;
for ( ; ; ){
sort(section1,
NAME);
count++;
sort(section1,
AGE);
count++;
sort(section1,
ID);
count++;
}
}
47
www.DataSheet4U.com
Содержание CE2000-H8S Series
Страница 2: ...Blank Page www DataSheet4U com...
Страница 22: ...Blank Page 8 www DataSheet4U com...
Страница 41: ...Blank Page 27 www DataSheet4U com...
Страница 57: ...Figure 6 1 Basic Bus Cycle Timing in Expanded mode 43 www DataSheet4U com...
Страница 59: ...Blank Page 45 www DataSheet4U com...
Страница 84: ...70 Blank Page www DataSheet4U com...
Страница 88: ...Part Number 8830E 080 170S Unit mm inch B 2 www DataSheet4U com...
Страница 95: ...Renesas Technology Asia Sales Offices URL http www renesas com G 1 www DataSheet4U com...
Страница 96: ...CE2000 www DataSheet4U com...