この問題を解決するのを手伝ってください。 -.-これを理解できません! 。あなたがコーディングの学習を始めたばかりのときにはとてもイライラします。関数内で宣言構文エラーが発生しました
、ボイドの問題エラー:宣言構文エラー のボイド表示エラー:ポインタの不正使用
謝罪私の中で任意の愚行が見つかった場合。
#include <iostream.h>
#include <conio.h>
#include <stdio.h>
#include <string.h>
class book
{
char bookname[20];
char isbn[20];
char author[20];
char category[20];
float price;
int noc;
public:
void accept()
{
cout<<"Enter book name :- \n";
gets(bookname);
cout<<"Enter isbn no of the book:- \n";
gets(isbn);
cout<<"Enter authour name:- \n";
gets(author);
cout<<"Enter category of book:- \n";
gets(category);
cout<<"Enter price of the book :- \n";
cin>>price;
cout<<"Enter no of copies of book available in the library :- \n";
cin>>noc;
}
void display()
{
puts(bookname)<<endl;
puts(isbn)<<endl;
puts(author)<<endl;
puts(category)<<endl;
cout<<price<<endl;
cout<<noc<<endl;
}
}b[5];
int main()
{
for(int i=0;i<5;++i)
{
b[i].accept();
}
void issue()
{
int flag=0;
char booksearch[20];
cout<<"Enter name of book member wants to issue :- \n"
gets(booksearch);
for(i=0;i<5;++i)
{
flag=strcmp(booksearch,b[i].bookname)
}
}
if(flag==1)
{
b[i].display();
b[i].issue();
}
getch();
return 0;
}
より具体的にすることができますし、コードのいくつかを投稿する – Pavan
ようこそStackOverflow!時間をかけてhttp://stackoverflow.com/help/mcveをご覧ください。特に、あなたの質問に完全なコピー貼り付けエラーを含める必要があります。 –
プレーンテキストエディタまたはワープロを使用していますか? –