#include<conio.h>
#include<stdio.h>
#include<string.h>
void main()
{
typedef struct info
{
int *sno;
char name[20];
}info;
info s1,*p1;
int i=11;
clrscr();
p1=&s1;
s1.sno=&i;
strcpy(s1.name,"AMITA");
printf("%u",&i);
printf("\nsno->%u name->%s ",(p1->sno),p1->name);
printf("\nsno->%d name->%s ",*(p1->sno),p1->name);
getch();
}
#include<stdio.h>
#include<string.h>
void main()
{
typedef struct info
{
int *sno;
char name[20];
}info;
info s1,*p1;
int i=11;
clrscr();
p1=&s1;
s1.sno=&i;
strcpy(s1.name,"AMITA");
printf("%u",&i);
printf("\nsno->%u name->%s ",(p1->sno),p1->name);
printf("\nsno->%d name->%s ",*(p1->sno),p1->name);
getch();
}
No comments:
Post a Comment