View Full Version : Mastermind Problems - C++


Tyler
06-19-02, 09:42 PM
Hey guys. Mucho appreciation to anyone who can help me out with a couple problems I'm havin here. Thanks!




if (instans=='y')
{
system("cls"); - implicit declaration of function 'int system(...)'
rules();
d=getch(); - implicit declaration of function 'int getchar(...)'
cin.ignore(80,'\n');
system("cls");
}

for (j=0; j<=9; j++)
{
strcpy(guess[j]," ");
strcpy(score[j]," ");
}

srand(time(NULL)); - implicit declaration of function 'int srand(...)'


for(j=0; j<4; j++)
{
x=rand()%6; - implicit declaration of function 'int rand(...)'
answer[j]=colour[x];
}

Tyler
06-19-02, 10:01 PM
Ah, well, never mind.

now it says on line 176:
-------------------------------------------

d=getch();
---------------------------------------------

176 untitled1.cpp
implicit declaration of function `int getchar(...)'
------------------------------------------------------------------

I got rid of the other problems apparently by just adding in stdlib.h

Ender
06-25-02, 09:56 AM
did you

#include <conio.h>

Ender
06-25-02, 09:57 AM
<conio.h>

Ender
06-25-02, 09:58 AM
conio.h

...work!!

Sorry for the other 2!!

Tyler
06-25-02, 06:02 PM
Eventually I realized that!

Thanks!