gpt4 book ai didi

C++错误 "too few arguments to function"

转载 作者:行者123 更新时间:2023-11-30 20:07:32 33 4
gpt4 key购买 nike

我有一个 C++ 程序显示错误:

too few arguments to function void split(char*, char**, int, int, int*)

代码:

#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
}

谁能告诉我出了什么问题吗?

最佳答案

函数 split 有 5 个参数,没有默认参数。您尝试使用 4 个参数来调用它。那是行不通的。

关于C++错误 "too few arguments to function",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12113317/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com