- 论坛徽章:
- 1
|
楼上的兄弟,你把这两个程序编译后看看!
程序 a
- #include <stdio.h>
- #include <curses.h>
- int main(viod)
- {
- chtype ch;
- WINDOW *w_main;
- initscr();
- w_main = newwin(24,78,0,0);
- box(w_main,0,0);
- touchwin(w_main); wrefresh(w_main);
- ch =wgetch(w_main);
- system("b");
- wmove(w_main,6,16);
- touchwin(curscr); wrefresh(curscr);
- ch = wgetch(w_main);
- delwin(w_main);
- endwin();
- exit(0);
- }
复制代码
程序 b
- #include <stdio.h>
- #include <curses.h>
- int main(viod)
- {
- chtype ch;
- WINDOW *w_main1,*w_cs;
- initscr();
- w_main1 = newwin(24,78,0,0);
- werase(w_main1);
- touchwin(w_main1); wrefresh(w_main1);
- w_cs = newwin( 22,76,1,1);
- box(w_cs,0,0);
- wmove(w_cs,6,16);
- wprintw(w_cs,"this is example !");
- touchwin(w_cs); wrefresh(w_cs);
- ch = wgetch(w_cs);
- delwin(w_main1); delwin(w_cs);
- endwin();
- exit(0);
- }
复制代码
运行程序 a ,在程序 a 中调用程序 b 。 |
|