works prefect
Code:
#include<stdio.h>
#include<string.h>
struct list
{
char first[20];
char name[20];
char blahblah[40];
};
void get_struct(struct list * x);
main()
{
struct list data[4];
struct list *ptr;
ptr=data;
get_struct(ptr);
}
void get_struct(struct list *x)
{
int i;
for(i=0;i<4;i++)
{
strcpy((x+i)->first,"storm");
strcpy((x+i)->name," man");
strcpy((x+i)->blahblah,"Is nothing But A good Lie");
printf("\nfisrt=%s",(x+i)->first);
printf("\nname=%s",(x+i)->name);
printf("\nlif is %s",(x+i)->blahblah);
strcat((x+i)->first,(x+i)->name);
printf("\nme =%s\n",(x+i)->first);
}
printf("Good Night");
}
but why i can't do
Code:
((x+i)->first)="storm";
?
isn't x+i-> access the first array ?
thanks again