示例#1
0
static inline void	midi_change(int md)
{
	int	c;
	char	tmp0[64];

	if(md!=0 && outch==0){return;}

	B_CLR_AL();C_WINDOW(0,32);
	if(md==0){
		msg("OUT MIDI CH.=");
		strcpy(tmp0,chstr(outch));
		sinput(tmp0,0x803);c=strch(outch,tmp0);

		if(c>=0 && c<=32){outch=c;}
		msg_clr();B_LOCATE(38,31);
		if(outch!=0){B_PRINT(chstr(outch));B_PRINT(" ");}else{B_PRINT("THRU");}
	}else{
		c=timsel(outch,0,36,prog);if(c>=0){c=c&0xff;}
		if(c>=0){
			prog=c;strcpy(tmp0,"PROGRAM:");strcat(tmp0,prog_name(outch,0,c,1));
			B_LOCATE(44,31);B_PRINT(tmp0);
		}
		midi_chout(0xc0+((outch-1)&15));midi_chout(prog);
	}
	C_WINDOW(4,26);B_LOCATE(0,0);
}
示例#2
0
int main()
{
    char ch;
    char * string = "shaozhengjiang";
    char * res;
    char * strch(char *, char);

    puts("Enter the charactor you want(CTRL+Z to quit): ");
    ch = getchar();
    getchar();  //滤去换行符
    while(ch != EOF)
    {
        res = strch(string, ch);
        if(res)
            printf("The address of %c is %p\n", ch, res);
        else
            printf("%c is not in %s\n", ch, string);
        puts("Enter another charactor you want(CTRL+Z to quit): ");
        ch = getchar();
        getchar();  //滤去换行符
    }
    
    return 0;
}