0
このエラーは、プロトタイプとヘッダーの引数がヘッダーのものと一致しないことを理解していますが、コードでは一致しています。私はここに何が欠けているのか分からないのですか? "showInfo(info、SIZE);"のエラー"オーバーロード関数のインスタンスがありません"
#include <iostream>
#include <iomanip>
#include <string>
using namespace std;
const int SIZE = 3;
int main();
void showInfo(Author info[], const int &);
struct BookInfo
{
string title;
double price;
};
struct Author
{
string name;
BookInfo books[SIZE];
};
int main()
{
Author info[] = { {"NONE", {{"NONE", 0.00}, {"NONE", 0.00}, {"NONE", 0.00}}},
{"NONE", {{"NONE", 0.00}, {"NONE", 0.00}, {"NONE", 0.00}}},
{"NONE", {{"NONE", 0.00}, {"NONE", 0.00}, {"NONE", 0.00}}},
};
showInfo(info,SIZE);
return 0;
}
void showInfo(Author info[], const int&)
{
for (int i = 0; i < SIZE; i++)
{
cout << info[i].name << endl;
for (int j = 0; j < SIZE; j++)
{
cout << info[i].books[j].title << endl;
cout << info[i].books[j].price << endl;
}
}
}
これにより、エラーが「タイプ名が許可されていません」 – Nick5227
に変更されました。間違っているはずです。別の質問を投稿して、コードの新しいバージョンを表示してください。 –
オリジナルの投稿を更新します。繰り返しの質問でstackoverflowを利用したくありません! – Nick5227