[below structure contains s1.name contain array of string name. to check if user entered name in that array list. i need to compare words by words. but my problem is that since string is stored in array. and string itself is an small array. so i dont know how can i reach to each single words of string stored in array.]
/*program to input students details in structure and display its out put and search availability of student by its name without using strcmp()*/
#include<stdio.h>
#include<string.h>
int main(){
int i,n;
struct school{
int regno;
char name[20];
int class;
}s1[10];
printf("\n enter the no of details of student to be added\n");
scanf("%d",&n);
for(i=0;i<n;i++){
printf("enter the student %d details\n", i);
printf("enter reg no");
scanf("%d",&s1[i].regno);
printf("name ");
scanf("%s",&s1[i].name);
printf("class ");
scanf("%d",&s1[i].class);
}
printf("\n*****RESULT ARE AS FOLLOW*****\n");
printf(" NAME CLASS REG NO \n");
for(i=0;i<n;i++){
printf("%s %d %d ",s1[i].name,s1[i].class,s1[i].regno)
printf("\n");
}
}