Untitled
unknown
plain_text
2 years ago
613 B
3
Indexable
#include<stdio.h> #include<conio.h> #include<string.h> struct fileTable { char name[20]; int sb, nob; } ft[30]; void main() { int i, j, n; char s[20]; printf("Enter no of files :"); scanf("%d",&n); for(i=0;i<n;i++) { printf("\nEnter file name %d :",i+1); scanf("%s",ft[i].name); //File Created printf("Enter starting block of file %d :",i+1); scanf("%d",&ft[i].sb); printf("Enter no of blocks in file %d :",i+1); scanf("%d",&ft[i].nob); } printf("\nEnter the file name to be searched -- "); scanf("%s",s); for(i=0;i<n;i++) if(strcmp(s, ft[i].name)==0)//Check for File Name break; if(i==n)
Editor is loading...