Home > Back-end >  Error C2065: 'setpalette: undeclared identifier problem for help, thank you very much
Error C2065: 'setpalette: undeclared identifier problem for help, thank you very much

Time:09-16

# include "stdio.h"
# include "graphics. H"
# include "conio. H"
Void PIC (void);
Void CPA (void);
Void cir (int x, int y, int r, int color);
Void main (void)
{
Int driver=DETECT mode;
Initgraph (& amp; Driver, & amp; Mode, "");
PIC ();
Getch ();
CPA ();
Closegraph ();
}
Void PIC (void)
{
int i;
for(i=1; i<16. I++)
Cir (40 * I, 350, 20, I);
}
Void cir (int x, int y, int r, int color)
{
Setcolor (WHITE);
Setfillstyle (1 color);
Circle (x, y, r);
Floodfill (x, y, WHITE);
}
Void CPA (void)
{
Int I=1, j=1;
While (1)
{
for(i=1; i<16. I++)
{
Setpalette (I, I + j);
Sleep (2000);
If (kbhit ())
return;
}
j++;
If (j==16)
j=1;
}
}
This is by TC program to VC, but the error C2065: 'setpalette: undeclared identifier this error, check on the Internet also does not have a solution, hope can be given by predecessors solution, thank you very much,

CodePudding user response:

Try & lt; Stdio. H>

CodePudding user response:

reference 1st floor focuslight response:
try & lt; Stdio. H>

Em, there is the problem

CodePudding user response:

Should be the lack of libraries and header files ~ in addition, TC old compiler, suggestion with the latest compilers, in addition, to learn the new function interface

CodePudding user response:

references 4 building self-confidence boy reply:
should be lack of libraries and header files ~ in addition, the TC very old compiler, suggestion with the latest compilers, on the other hand, learn the new function interface ~

Ha ha, this is the teacher's job is to tc to vc, thank you for guidance
  • Related