printing a shape in ncurses

now that my problem is i want to print a shape like below but all my coding is invain coz its not hapenning so can any one correct my coding

the shape i want to print is

*
**
***
****
*****

starting coordinates are (5,20)

#include<ncurses.h>

void printshape(int row, int col);
void eraseshape(int row, int col);

int main()
{
initscr();
printshape(5,20);
getch();
endwin();
}


void printshape(int row,int col)
{
for(int x=row;x<10;x++)
{
for(int y=col;y<25;y++)
{
move(x,y);
printw("*");
}
}
}

void eraseshape(int row,int col)
{
for(int i=row;i<=row+col;i++)
{
for(int j=col;j<=row+col;j++)
{
move(i,j);
printw("*");
}
}
}


Please only post to one forum. I've posted a suggestion in the beginners forum against your post
sorry bnbertha i was mistakenly posted this sorry ok
Topic archived. No new replies allowed.