No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
#include<iostream> #include<fstream> #include<iomanip> using namespace std; class lohi { int x; int y; public : lohi() { x=10; y=20; } }X; int main() { fstream io; io.open("just1",ios::in | ios:: out | ios::app); io.write((char*)&X,sizeof(X)); io.close(); } in this programme i expect a file to be created and contents of x,y to … |
|
/tmp/ccSx0L0H.o: In function `employee::getdata()': multi.cc:(.text._ZN8employee7getdataEv[employee::getdata()]+0x31): warning: the `gets' function is dangerous and should not be used. |
|
[code=cplusplus] #include<iostream> using namespace std; class item { int itemno; int itemprice; public : static int total; void getprice(); void printprice(); friend void calculate(item a); }; int item :: total=0; void item :: getprice() { cout<<"Print item number \n"; cin>>itemno; cout<<"Print item price \n"; cin>>itemprice; total++; } void item :: … |