I try to use freopen (“inputString.txt”,”r”,stdin); to send
input to standard input.If I run program in eclipse the output is
xxx
but if I run program directly (run *.exe after compile without eclipse)
the output is goodxxx
The text file is in the same directory of *.exe in eclipse project.
How can I fix this.
Here is some of my sourcecode.
int main() {
int debug = 1,width,height;
char s[1000];
freopen ("inputString.txt","r",stdin);
s[0]='x';
scanf("%s",s);
printf("%s",s);
printf("xxx")for(;;);;
return 0;}
inputString.txt contain
good
Just put file in the root directory of the project.