Hi,
I have written this code, but it seems some thing wrong with this. Please help me to solve this. I want this application in DOS or windows environment. If possible please provide me the full coed.
Thanks a lot.
CODE
# include <stdio.h>
#include<conio.h>
#include<string.h>
main()
{
char fname[12];
char first[8], ext[3], command[100];
int i=0;
clrscr();
printf("Enter file name : ");
scanf("%s",&fname);
// fflush(stdin);
// get(fname);
while(fname[i]!=".") //INVALID INDIRECTION//AND//TOO FEW PARAMETERS IN CALL TO STRCMP
{
first[i]=fname[i]; //INVALID INDIRECTION//
i++;
}
while(fname[i]!="/0") //INVALID INDIRECTION//
{
ext[i]=fname[i]; //INVALID INDIRECTION//
i++;
}
strcat(command,"dir ");
if(strcmp(first,NULL)!=0)
strcat(command,first);
if(strcmp(ext,NULL)!=0)
{
strcat(command,".");
strcat(command,ext);
}
}