#include "./func/func.h"

int main() {
    int enter,
    q = 1,
    massSize = 0,
    massCreated = 0,
    massive[MAXMASSIVESIZE];
    printf("Test massives and pointers\n");

    do{
        printf("\t\tMain menu\n");
        printf("\tMassive manipulation\n");
        printf("a. SetMassiveSize\n");
        printf("b. FillMassive\n");
        printf("c. ViewMassive\n");
        printf("d. SelectFunc\n\n");
        printf("\tExit - g\n\n\n");
        enter = getchar();
        if(flush())return 1;
        switch(enter){
            case'a':case'A':
                setmass(&massSize);
                break;

            case'b':case'B':
                if(massSize!=0){massCreated = fillmass(
                    massSize,massive);flush();}
                else printf("\n\tSet massive size first.\n\n");
                break;

            case'c':case'C':
                if(massCreated){viewmass(massSize,massive);}
                else printf("\n\tFill Massive first.\n\n");
                break;

            case'd':
                if(massCreated){selfunc(massSize,massive);flush();}
                else printf("\n\tFill Massive first.\n\n");
                break;

            case'g':case'G':
                q=0;break;            

            default: printf("Input Err\n\n");break;
        }
     }while(q);
    return 0;
}
