Shadowlord Posted April 12, 2008 Share Posted April 12, 2008 Here's my code: void playGame(char*); void adjudicateGuess (char*, char*, int); void mastermind (char*); char* GenerateCode(); void playOneTurn (char*); char* calcBlack (char*); char* calcWhite (char*); int WinOrLose (int, int); void print_feedback(); void mastermind (char* Gen_code) { //generate code --> char * char* Secret_code; } char* GenerateCode () { char* Gen_code; //generates code //outputs random code } void playOneTurn (char* Secret_code) { //User input (guess code) char* Guess_code; //scanf("%d",Guess_code); printf("one turn"); } void playGame (char* Secret_code) { //loop; playOneTurn * 10 int i; int turnValue = 10; for (i=0;i<turnValue;i=i+1) { playOneTurn(Secret_code); } } void adjudicateGuess (char* Guess_code,char* Secret_code, int WinOrLose) { //check positions, winorlose/print white pegs, print black pegs } char* calcBlack (char* Secret_code) { int blackpegs; } char* calcWhite (char* Secret_code) { int whitepegs; } int WinOrLose (int whitepegs,int blackpegs) { //does player win or lose? } void print_feedback () { } int main () { char c; playGame (); c = getchar (); } ------------------------------------------------------------------------------------------------------ The error says: H:Documents2008SDDCodeCMasterMindmastermind. c In function `main': 64 H:Documents2008SDDCodeCMasterMindmastermind. c too few arguments to function `playGame' ---------------------------------------------------------------------------------------------------------- I can't seem to work out what's wrong. Any assistance is greatly appreciated. :) Quote Link to comment Share on other sites More sharing options...
thegubble Posted April 13, 2008 Share Posted April 13, 2008 I don't do much C any more, but as it is similar to C#, i can help a bit. You define play game as: void playGame(char*); but when you call it, you don't give the function argument: playGame (); So all you need is to have a char* variable as an argument, and it should work. Quote Link to comment Share on other sites More sharing options...
Shadowlord Posted April 14, 2008 Author Share Posted April 14, 2008 thanks :) Quote Link to comment Share on other sites More sharing options...
Shadowlord Posted April 14, 2008 Author Share Posted April 14, 2008 That helped, no more error. :) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.