By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,159 Members | 882 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,159 IT Pros & Developers. It's quick & easy.

file handling along with link list

P: 1
Here will designing the code for the library management software i am facing the problem while handling the data of the variables
I am not able to insert the data into the file(specifically of the character arrays)
and extracting it fom the file. Might be possible there is a peoblem in my approach
I am designing it with the help of OOP i.eclasses
untill now i have made a structure inside the class.
plz suggest me the way to implement them (i.e how to deal for addbook function)
<required header files>
class library
{
private:
struct book
{ char bname[50],bpublisher[100],bauther[50;
int bookid,bprice;
}b;
fstream bfile;
public:
void addbook();
.............
..............
...........
}
Mar 8 '07 #1
Share this Question
Share on Google+
2 Replies


sicarie
Expert Mod 2.5K+
P: 4,677
Here will designing the code for the library management software i am facing the problem while handling the data of the variables
I am not able to insert the data into the file(specifically of the character arrays)
and extracting it fom the file. Might be possible there is a peoblem in my approach
I am designing it with the help of OOP i.eclasses
untill now i have made a structure inside the class.
plz suggest me the way to implement them (i.e how to deal for addbook function)
<required header files>
class library
{
private:
struct book
{ char bname[50],bpublisher[100],bauther[50;
int bookid,bprice;
}b;
fstream bfile;
public:
void addbook();
.............
..............
...........
}
Just out of curiosity - why not create a separate book class as well? That would avoid the pointer implementation of a struct (using ->).
Mar 8 '07 #2

P: 93
Here will designing the code for the library management software i am facing the problem while handling the data of the variables
I am not able to insert the data into the file(specifically of the character arrays)
and extracting it fom the file. Might be possible there is a peoblem in my approach
I am designing it with the help of OOP i.eclasses
untill now i have made a structure inside the class.
plz suggest me the way to implement them (i.e how to deal for addbook function)
<required header files>
class library
{
private:
struct book
{ char bname[50],bpublisher[100],bauther[50;
int bookid,bprice;
}b;
fstream bfile;
public:
void addbook();
.............
..............
...........
}


Do you only have one book in the library?
As it was mentioned in the other post, how about creating a new Book class itself?
Mar 9 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.