void spriteput(int x,int y, int stype)
{
char sprite1[5]="OOOO";
char sprite2[5]="OOOO";
char sprite3[5]="OOOO";
char sprite4[5]="OOOO";
if (stype == 1)
{
char sprite1[5] = " OO ";
char sprite2[5] = "OOOO";
char sprite3[5] = "OOOO";
char sprite4[5] = " OO ";
mvprintw(2,y,"%s \n",sprite1);
}
mvprintw(x+1,y,"%s \n",sprite2);
mvprintw(x+2,y,"%s \n",sprite3);
mvprintw(x+3,y,"%s \n",sprite4);
}
If I am right, the code block should be printed on the NCURSES screen.
OO
OOOO
OOOO
OO
Instead, it prints the default text (first char). Can someone tell me why this is? The statement printwinside the If block produces the correct text, so it is assigned correctly. Thank you in advance.
source
share