break it down.
design it before you code it.
how do you represent a book?
after you represent it, how do you get data into it?
what do you need to do to one book (copy? compare by (so can be sorted?)? load/save to disk or serialize? )
how do you make a table of them? is it just an stl container, or do you need more stuff?
PLEASE ALWAYS USE CODE TAGS (the <> formatting button) when posting code.
It makes it easier to read your code and also easier to respond to your post. http://www.cplusplus.com/articles/jEywvCM9/
Hint: You can edit your post, highlight your code and press the <> formatting button.
void menu(void)
int main();
class book
{
char title;
char author;
char editorial;
char genre;
int main()
{
cout << "Welcome to table of books" << "\n";
You have been asked to use code tags. PLEASE DO SO. http://www.cplusplus.com/articles/jEywvCM9/
Hint: You can edit your post, highlight your code and press the <> formatting button.
If you're not going to make the slightest bit of effort to make your posts readable, why should we spend the slightest bit of effort helping you?
What do you mean by this? forward declaration needs a ;
Line 1 and line 2 (see my previous post) appear to be forward declarations. Forward declarations must be terminated with a semicolon.
Yes , I am sure , I want to store title, author, editorial and genre of each book
As I pointed to you before, you're allocating only a single character for title, author, editorial and genre. How many book titles consist of only a single character? Do you know how to use std:string? You want to store those items as a strings not as single characters.
help us help you.
you have 2 mains in that last pile. throwing code on the page isnt helpful. I already said, stop to design a bit before you make a mess. And try to produce a small amount that works, rather than a spew that isnt even close to compiling or correct or useful.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
void menu(void) //missing ;
int main();
class book //class inside main
{
char title;
char author;
char editorial;
char genre;
int main() //main again? where is end of class } marker?
{
cout << "Welcome to table of books" << "\n";
menu();
};
------------------
class book //try this...
{
string title;
string author;
string editorial;
string genre;
};
You have been asked multiple times to use code tags. PLEASE DO SO. http://www.cplusplus.com/articles/jEywvCM9/
Hint: You can edit your post, highlight your code and press the <> formatting button.
If you're not going to make the slightest bit of effort to make your posts readable, why should we spend the slightest bit of effort helping you?
I will not respond further until you apply code tags.