" After I have compiled my program I have an executable file.
To execute it from the command prompt:
test.exe <test.in >test.out
Where test.exe is the name of my compiled executable, test.in is a text file for input, test.out is a text file that your resut will be output to.
But I dont kow HOW to do it..I ve searched a lot in google and I have got this answer...
Will you Please tell me more with code..
I have a code in which there is NZEC error and so I ve thaught to redirct the input from FILE..Will you tell me please what changes should be made in my code.
In this code , input is a 2 character string , if input is db, pq ,qp or bd output will be Mirrored pair. if two spaces are entered , program will terminate else print Ordinary pair.
#include<stdio.h>
#include<string.h>
int main()
{
char n[2];
int i=0;
printf("Ready\n");
while(gets(n))
{
if(strcmp(n," ")==0) break;
if(strcmp(n,"pq")==0 || strcmp(n,"bd")==0 || strcmp(n,"qp")==0 || strcmp(n,"db")==0)
{ printf("Mirrored pair\n");i++; continue;}
else
printf("Ordinary pair\n");
i++;
}
return(0);
}