⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 80.c

📁 C语言实战105例/王为青, 陈圣亮编著 北京-人民邮电出版社 2007 光盘源码及可运行程序 附注项:共汇集了105个实例
💻 C
字号:
#include <process.h> 
#include <string.h> 
#include <stdio.h> 
#include <dos.h> 
#define BUFFERSIZE 128
int main() 
{ 
   char filename[BUFFERSIZE]; 
   struct fcb fctlblk; 
   clrscr();
   puts("*****************************************");
   puts("*     This program will get             *");
   puts("* the information of file control block *");
   puts("*****************************************");
   puts("Please input the drive and file name.");
   puts("Such as: c:filename.");
   while(1)
   {
	   /* get file name */  
	   gets(filename); 
	   if(filename[0] == '\0')
	     break;
	   /* put file name in fcb */ 
	   if (parsfnm(filename, &fctlblk, 1) == NULL) 
	   {
	      printf("Error in parsfm call\n"); 
	      return 0;
	   }
	   /*输出文件所在的磁盘*/
	   printf("\n >>The drive is:");
	   switch(fctlblk.fcb_drive)
	   {
	   	case 1:
	   	  printf("A.\n");break;
	   	case 2:
	   	  printf("B.\n");break;
	   	case 3:
	   	  printf("C.\n");break;
	    case 4:
	   	  printf("D.\n");break;
	    case 5:
	   	  printf("E.\n");break;
	   }
	   /*输出文件的名字*/
	   printf(" >>The filename is: %s\n",fctlblk.fcb_name);
	   /*输出文件的扩展名*/
	   printf(" >>The extention name is: %s\n\n",fctlblk.fcb_ext);
   }
   getch();
   return 1; 
} 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -