K
key9
Hi All
On coding , I think I need some basic help about how to write member
function .
I've readed the FAQ, but I am still confuse about it when coding(reference /
pointer /instance) , so I think I need some "template".
Sorry for my coding experience in c++
Suppose we have
class FooClass{
public:
/*
foo() // this is what I want to ask below
*/
private:
string str;
}
What I need "template" is:
1. Use a outside string (string*,string&) to replace string content in class
string* outp;
string outi;
string& outr;
how to write these three foo()?
2. 1 outside will get string content inside of class, but outside can not
change it, (return a copy/return const pointer)
2. 2 outside will get string content inside of class, but outside can change
it, (return a point/reference)
3. outside can get string which have processed in foo()
string* foo(){
string* temp;
temp = processof(str);
return temp*
}
how to use autoptr to void mem leak? if I forgot delete temp* outside?
your help will save my life
key9
keep trying ......
On coding , I think I need some basic help about how to write member
function .
I've readed the FAQ, but I am still confuse about it when coding(reference /
pointer /instance) , so I think I need some "template".
Sorry for my coding experience in c++
Suppose we have
class FooClass{
public:
/*
foo() // this is what I want to ask below
*/
private:
string str;
}
What I need "template" is:
1. Use a outside string (string*,string&) to replace string content in class
string* outp;
string outi;
string& outr;
how to write these three foo()?
2. 1 outside will get string content inside of class, but outside can not
change it, (return a copy/return const pointer)
2. 2 outside will get string content inside of class, but outside can change
it, (return a point/reference)
3. outside can get string which have processed in foo()
string* foo(){
string* temp;
temp = processof(str);
return temp*
}
how to use autoptr to void mem leak? if I forgot delete temp* outside?
your help will save my life
key9
keep trying ......