#include<iostream.h>
#include<conio.h>
struct book
{
private:
int bn;
float bp;
int pn;
public:
void read()
{
cout<<"Enter The Book No \n";
cin>>bn;
cout<<"Enter The Book Price \n";
cin>>bp;
cout<<"Enter The No Of Pages \n";
cin>>pn;
}
void setv1()
{
bn=10;
bp=20;
pn=30;
}
void setv2(int a,float b,int c)
{
bn=a;
bp=b;
pn=c;
}
void display()
{
cout<<"Book No Is"<<bn<<"\n";
cout<<"Book Price Is"<<bp<<"\n";
cout<<"No Of Pages Is"<<pn<<"\n";
}
void main()
{
clrscr();
book b1,b2;
cout<<"Enter Book NO";
cout<<"Enter Book Price";
cout<<"No Of Pages";
b1.read();
b2.read();
b1.display();
b2.display();
b1.setv1();
getch();
}
i have an error in this program
"declaration termination incorrectly"
what can i do
This post has been edited by jimblumberg: 08 October 2012 - 09:22 AM
Reason for edit:: Added missing Code Tags, Please learn to use them.

New Topic/Question
Reply



MultiQuote





|