pointer to function with structure

Doug East dre at ptsfa.UUCP
Wed Feb 6 14:27:29 AEST 1985


> 	while(gets(gt) != NULL) {
> 		switch(gt[0]) {
> 			case '1':
> 				(*mesg[0].funcp)(1);
> 				break;
> 			case '2':
> 				(*mesg[1].funcp)(2);
> 				break;
> 		}
> 	}
> }

Actually, this works quite well also:
	.
	.
	.
 	while(gets(gt) != NULL) {
 		switch(gt[0]) {
 			case '1':
 				mesg[0].funcp(1);	/* (*...) absent */
 				break;
 			case '2':
 				mesg[1].funcp(2);	/* (*...) absent */
 				break;
 		}
 	}
	.
	.
	.
-- 

------------------------------------------------------------------------------

Doug East (Pacific*Bell -- San Francisco)
{ihnp4,ucbvax,cbosgd,decwrl,amd70,fortune,zehntel}!dual!ptsfa!dre



More information about the Comp.lang.c mailing list