need help
what the problem!!
first code supose to be implimntation of my code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
#include<iostream>
#include<string>
#include"f.h"
using namespace std;
weppage::weppage(){}
weppage::weppage(string f,float fi){
file_name=f;
filesize=fi;
}
string weppage::getfile_name(){return file_name;}
void weppage::setfile_name(string f){
file_name=f;
}
float weppage::getfilesize(){return filesize;}
void weppage::setfilesize(float fi){filesize=fi;}
void weppage::print(){
cout<<"the file name is "<<file_name<<endl;
cout<<"the file size is "<<filesize<<endl;
}
weppage::weppage f1( weppage obj){
cout<<"the file name is "<<obj.getfile_name()<<endl;
cout<<"the file size is "<<obj.getfilesize()<<endl;
return obj;
}
|
this is th interface
[/code]
#include<iostream>
#include<string>
using namespace std;
class weppage{
string file_name;
float filesize;
public:
weppage();
weppage(string f,float fi);
string getfile_name();
void setfile_name(string f);
float getfilesize();
void setfilesize(float fi);
void print();
weppage f1( weppage obj);
};
[/code]
main part
[/code]
#include<iostream>
#include<string>
#include"f.h"
using namespace std;
int main(){
weppage obj("c++ book",34);
weppage obj;
cout<<fun(obj);
system("pause");
return 0;
}
[/code]
That's what YOU are supposed to tell us. Then we may be able to tell you the cause of the problem.
sorry i know i should write my question but i for get to past it sorry again,
the question is in 21 line it give me red line undr it.i dont know why
f1 is not a constructor, add return data type before function
Topic archived. No new replies allowed.