To get you started, here's a simple example program using an "input mask" like you outlined:
#include <curses.h>
#include <stdio.h>
int main(void)
{
char name[60];
char phone[60];
char addr[60];
initscr();
mvaddstr(0, 0, "name:");
mvaddstr(1, 0, "phone:");
mvaddstr(2, 0, "address:");
mvgetnstr(0, 9, name, 59);
mvgetnstr(1, 9, phone, 59);
mvgetnstr(2, 9, addr, 59);
endwin();
// using curses ends here, so we can use `stdio` functions like
// `printf()` again.
printf("name: %s\n", name);
printf("phone: %s\n", phone);
printf("address: %s\n", addr);
return 0;
}
Link this with a curses
library suitable for your platform (on Linux, use -lncurses
when compiling, on windows, get and link pdcurses
).
I suggest you read the NCURSES Programming HOWTO for learning more about curses
.