typedef struct film{ int size; int pixel; float price;}xyz,pqr;struct film *jadu(){ static xyz one={231,12,900.0},*p=&one; return p;}void main(){ pqr *ptr; ptr=jadu(); clrscr(); printf("%d",ptr->pixel); getch();}Output:12ONE MORE EXAMPLE:typedef struct book{ char *name; int id; float price;}BOOK;BOOK show(); void main(){ BOOK list; list=show();
No comments:
Post a Comment