Sunday 11 January 2009

Create dos command: type in c language.

#include “stdio.h” void main(int count,char * argv[]) { int i; FILE *ptr; char *str; char ch; if(count==1) { printf("The syntax of the command is incorrect.\n"); } for(i=1;i { ptr=fopen(argv[i],"r"); if(ptr==NULL) { printf("The system cannot find the file specified."); if(count>2) printf("\nError occurred while procesing : %s.\n",argv[i]); } else { if(count>2) { printf("%s

No comments:

Post a Comment