/*************************************************************************
 * prime1.c:
 *                      MICROTEK  1997,03,06
 *************************************************************************/
#include _SFR_H_
#include <fpal96.h>

#include <string.h>
#define MAX 10

extern void TestArray();

/* local data declaration */


int day,nVar[7];
static char pszBuff[] = "Hello! Gates, this is your cakes!";

char text[] = "make out a good case for yourself!";

union unLong_tag{
    char m_char[4];
    short m_short[2];
    long m_long;
} unLong;

const int TRUE = 1;
const int FALSE = 0;
static char strArr[12][10]=
			{"Daniel","John","Carl","Annie","Dong","Chen","Gates",
			 "Frank","Roger","Jerry","Moon","Irene"};

extern void SortArray(char array[12][10],int n);
extern void TestOperator();
void main()
{
    int j = 0;

    signed char chVar;
    unsigned char uchVar;
    char *pch;

    char *ch;

    short shVar;
    unsigned long ulVar;
    float fVar1, fVar2, fVar3;
    unLong.m_long = 0;

    while (1) {
        for (day = 0; day <= 6; day++) {
            switch (day) {
                case 0:
                 TestOperator();
                    break;
                case 1: /* test pointer */
                    pch = pszBuff;
                    *(pch+ 6*sizeof(char)) = '\0';
                    break;
                case 2: /* test data type support */
                    uchVar = 0xf0;
                    chVar = uchVar;

                    unLong.m_char[2]= chVar;
                    nVar[day] = unLong.m_short[0];
                    ulVar = (unsigned long) unLong.m_long;

                    fVar1 = 1.2345;
                    fVar2 = fVar1 - 2.2345;	/* fVar2 = -1.00000 */
                    fVar3 = fVar1 + fVar2;	/* fVar3 = -0.234500 */
                    break;
										
                case 3:
                	j = 12;
                	SortArray(strArr,j);
                    break;

                case 4:
                    ch=text;
                    nVar[day]=0;
                    for(;;)
                    {
                        if (*ch==0)
                            goto END;
                        nVar[day]++;
                        ch++;
                    }
                    END:
                        break;

                case 5:
                    TestArray();
                    break;

                default:
                    break;
            }
        } /* end of for */
    }     /* end of while */
}         /* end of main */

                                  
                                  
