示例#1
0
/**************************************************> main <*/
int main (int argc, const char * argv[])
{
	char			command;
	
	gHeadPtr = NULL;
	gTailPtr = NULL;
	
	ReadFile();
	
	while ( (command = GetCommand() ) != 'q' ) {
		switch( command ) {
			case 'n':
				AddToList( ReadStruct() );
				break;
			case 'l':
				ListDVDs();
				break;
		}
	}
	
	WriteFile();
	
	printf( "Goodbye..." );
	
	return 0;
}
示例#2
0
文件: main.c 项目: bhavishyamathur/C
int main (int argc, const char * argv[])
{
    char command;
    
    printf("Press q - quit, n - new entry, l - list entries or r - reversed list: ");
    while ((command=ReadInstr())!='q') {
        switch (command) {
            case 'n':
                ArrangeDVD(NewDVD());
                break;
            case 'l':
                ListDVDs(false);
                break;
            case 'r':
                ListDVDs(true);
                break;
            default:
                printf("Press q - quit, n - new entry, l - list entries or r - reversed list: ");
                break;
        }
    }
    printf("Goodbye, thank you for using me!\n");
    exit(0);
}
示例#3
0
文件: main.c 项目: bhavishyamathur/C
int main (int argc, const char * argv[])
{
    char command;
    
    printf("Press q - quit, n - new entry or l - list entries: ");
    while ((command=ReadInstr())!='q') {
        switch (command) {
            case 'n':
                NewDVD();
                break;
            case 'l':
                ListDVDs();
                break;
            default:
                printf("Press q - quit, n - new entry or l - list entries: ");
                break;
        }
    }
    printf("Goodbye, thank you for using me!\n");
    exit(0);
}
示例#4
0
文件: main.c 项目: JackIrish/ios
int main (int argc, const char * argv[])
{
	char command;
    
	while ( (command = GetCommand() ) != 'q' ) {
		switch( command ) {
			case 'n':
				AddToList( ReadStruct() );
				break;
			case 'l':
			case 'r':
				ListDVDs( command=='l' );
				break;
		}
        printf( "\n----------\n" );
	}
	
	printf( "Goodbye...\n" );
	
	return 0;
}