hai all,
we are working on fork() for first time. we are able to work it out partly.
i have two process created with the help of fork().
In each process, i call a function with argument int value and file pointer.
The results of the function should have to written in the file corresponding to the file pointer in the function.
when i tried to do this, only the entries in the first file are being made and for the second file error has occurred.
how can i pass only the address of file to the function from main and can able to make entries into two files simultaneously.
i have tried these combinations,
in main,
func(1,fileprt);
in func,
void func(int i, file *file1){
fprintf(file1,"%d",x);
}