Hi, i am trying to redirect stdout, in a previous fourum i asked how to redirect ir to a file, and it works, but the thing its that i need to omit that file and save the stdout in a variable, so this variable can be accessed like a queue in c# this is my code, i am using JNI to run JBoss aplication server:
Code:
int main(int argc, char **argv) {
FILE *stream;
char linea[1024];
JNIEnv* env;
char acumulador[BUFSIZ];
stream = freopen("Hola.txt", "w", stdout);
env = create_vm();
invoke_class( env );
getchar();
}
I use this code and works prefectly but like I said i need to omit the hola.txt, i was thinking in some thing like
Code:
stream = freopen(acumulador, "w", stdout);
but it does not work
there its another C function named:
Code:
void setbuf(FILE *stream, char *acumulador);
but i dont know how to use it
can some one help me...
thanks in advance