Friday 29 May 2009

Function returning pointer to enum in c programming.

typedef enum color{a,b,c,d,e}co;enum color eee(){    static co x;    x=b+c/2;    return x;}void main(){    int num;    num=eee();    clrscr();    printf("%#d",num);    getch();}Output:2ONE MORE EXAMPLEenum color display();void main(){ int c; c=display(); printf("%d",c); getch();}typedef enum color{ black,blue,red,green }symbol; symbol display(){ symbol x=black+green;

No comments:

Post a Comment