I have a C++ program that shows an error:
too few arguments to function void split(char*, char**, int, int, int*)
Code:
#include <iostream>
#include <stdlib.h>
using namespace std;
void split(char* lin, char** word, int i, int w, int* c);
int main() {
char line[80] = "myline";
int n = 5;
char **word;
split(line, word, 1, 1); //Error is here.
return 0;
}
void split(char* lin, char** word, int i,int w, int* c)
{
//statements
}
Can anyone tell whats wrong?
The function split takes 5 arguments and no default argument. You try to call it with 4 arguments. That wont work.