Thanks Maniraja, it works correct, but I had to cancel the line: /*memcpy(tStdout, stdout, sizof(FILE));*/ because I got an error. I tried to execute without this line, and it seems to work well!
Maschwa
Hi Fredrik!
I tried to compile with 16bit Borland-compiler and 32bit DeveloperStudio. There was no warning in both cases. I tried the code of jtm111 but it doesn´t work with whitespaces, too.
Br maschwa
Hello Fredrik!
I think the better function for getting a string in a variable is gets() which is included in <stdio.h>.
for example:
#include <stdio.h>
void main(){
char var[20];
printf("Enter some text: ");
gets(var);
printf("%s",var);
}
But you must be careful with...
Hi all!
This is my problem:
void getfiles(char *f){
freopen(f,"a",stdout);
fprintf(f,"%s",system("dir /b c:\\bcn\\data\\*.*"));
fclose(f);
}
It works correctly, but the rest of the programm also is written in 'f'. I want to write the rest of output in normal...
Thank you very much 2ffat this was a great help for me. I´m right at the beginning in C-programming, so I have to learn very much. This site is really good for doing that.
br maschwa
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.