how to make child to print where the parent is printing using ncurses..
my sample code is
Code:
#include <stdio.h>
#include <sys/types.h>
#include <ncurses.h>
int main()
{
pid_t childPid = 0;
WINDOW *mywindow;
mywindow = initscr();
keypad(stdscr,TRUE);
childPid = fork();
if(childPid ==0)
{
wprintw(mywindow,"Inside Child\n");
refresh();
return 0;
}
else
{
wprintw(mywindow,"Inside Parent\n");
refresh();
}
wscanf(mywindow,"%c");
endwin();
wait();
return 0;
}
but the child part is not getting printed on the screen..
can anyone help me on this?