#include< ncurses.h >
int main()
{
initscr();
int y,x;
getmaxyx(stdscr,y,x);
int i=0;
int j=0;
for(;i < x;i++)
{
move(j,i);
printw("*");
refresh();
for(int k=0;k<1000000;k++)
{}
}
i--;
for(;j < y; j++)
{
move(j,i);
printw("*");
refresh();
for(int k=0;k<1000000;k++)
{}
}
j--;
for(;i>0;i--)
{
move(j,i);
printw("@");
refresh();
for(int k=0;k<1000000;k++)
{}
}
getch();
endwin();
return 0;
}
I wrote this program and compiled it.There haven't any errors.Then run it.Then I got an error.When printing "@" sign when loop working in between that loop there printing a space.It's not possible.But it was.Not way to correct it. Because there haven't any syntax or logic error.
So what is that should be????
No comments:
Post a Comment