|
CS256 - Fundamentals of Structured Programming
| Displaying exercises/e8/files/p4.c
#include <stdio.h>
#include <curses.h>
#include <string.h>
/**
* Re-use the getint() function from p2.c here:
*/
int getint(int y, int x, char *prompt)
{
}
/**
* Prompt for an X, Y, Width and Height integers using the getint() function,
* then clear the screen and draw a hollow box composed of hash marks (#) who's
* upper left corner starts at the x,y position input and is width and height
* in size. Then wait for a key-press to exit the program.
*/
int main(void)
{
/* Do not modify the following code: */
initscr();
clear();
int x = getint(10, 10, "X? ");
int y = getint(11, 10, "Y? ");
int w = getint(12, 10, "Width? ");
int h = getint(13, 10, "Height? ");
/**
* Clear the screen and draw a hollow box composed of hash marks (#) where the
* upper left corner starts at the x,y position input and is w characters wide
* (its width) and h characters high (its height) in size. Then wait for a
* key-press to exit the program.
*/
endwin();
return 0;
}
|