Getting error too few parameters in call to 'nme(char *, char *)



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
  #include <iostream.h>
#include <string.h>
#include <conio.h>
#include <stdio.h>
#include <math.h>
#include <dos.h>
void mm();
void help();
char nme(char [25], char[25]);

void mm()
{   clrscr();
    cout<<"||\t\t WELCOME TO THE GAME OF TIC-TAC-TOE \t\t||";
    cout<<"\n\t|| RULES ||";
    cout<<"\n 1) 2 players are needed to play this game \n 2) select the symbol \n 3) A player wins by being the first\n to connect a line of friendly pieces from one side or\n corner of the play area to the other \n 4) player 1 moves first in first game \n but not in second game if he looses in I game";
 }

void help()
{   clrscr();
    int cho2;
    cout<<"||\t\t GUIDE \t\t||";
    cout<<"\n\t * * * \t 1 2 3 \n\t * * * \t 4 5 6 \n\t * * * \t 7 8 9 \n ";
    cout<<"\n\n Suppose this is your play area, \n you have to just enter a number between 1-9 during your turn\n and then the  star corrosponded to that number\n will be replaced by the char you choose. \n A player wins by being the first\n to connect a line of friendly pieces from one side or\n corner of the play area to the other \n A piece should only be placed on any empty space(*). ";
    cout<<"\n The game ends when either one player wins\n or it is no longer possible for a player to win\n (in which case the result is a draw).";
    cout<<"\n\n to play enter";
    getch();

 }

void main()
{
    clrscr();
    int num,t1,t2,mp;
    char p1[25],p2[25],cho;
    mm();
    cout<<"\n\n\n\n DO YOU WANT TO KNOW HOW TO PLAY this game, \n Y=YES & N=NO(directly start playing game)\n ";
    cin>>cho;
    if(cho=='y'||cho=='Y')
    {  help();
     }
    if(cho=='n'||cho=='N')
    {  clrscr();
       nme(char p1); // error is here
       }
    getch();
 }

i'm trying to make a tic-tac-toe c++ program but when i want to call char function it is showing error. please help me i'm a noob
The nme function is expecting two arguments, but the call only sends one.

char nme(char [25], char[25]);

nme(char p1); // error is here

Also - when you call the function, you don't need the data type before the name of the argument.
i appreciate your help but can you tell exactly what to do. and i have also tried
char nme(char [25]
and
nme(p1);
and
nme(p1,p2)
please help me.
thanks in advance.
You still get an error with:
 
nme(p1,p2);

Is it the same error or another one?
Because nme(p1,p2) should work.
Last edited on
another
You have a function prototype for nme() but I don't see a definition for it. Have you written the code for that function?
what is that?
definition - The implementation. Where is the actual code for the function?

If you try to call a function which has only a prototype, you will get a linker error when you try to run the program.
shit thank you AbstractionAnon
Topic archived. No new replies allowed.