J
John Speth
Hi group-
I have what is a simple understanding problem with c++. I just can't see a
way to reference the base class data properly in my code. Here's my simple
code that is written in MFC:
class CStringTrim : public CString
{
void Trim(void)
{
// Strip comments
int n = Find('#');
if(n != -1) *this = Left(n);
// Clean the line
TrimLeft();
TrimRight();
}
};
I simply want to have Trim() discard a string comment (#) and then trim
leading and trailing whitespace and leave the resultant string data in
place. My problem is I don't know how to refer to base class' string value
(see my failed attempt at using "*this").
Can anyone please tell me how to accomplish this properly with c++?
Thanks, John
I have what is a simple understanding problem with c++. I just can't see a
way to reference the base class data properly in my code. Here's my simple
code that is written in MFC:
class CStringTrim : public CString
{
void Trim(void)
{
// Strip comments
int n = Find('#');
if(n != -1) *this = Left(n);
// Clean the line
TrimLeft();
TrimRight();
}
};
I simply want to have Trim() discard a string comment (#) and then trim
leading and trailing whitespace and leave the resultant string data in
place. My problem is I don't know how to refer to base class' string value
(see my failed attempt at using "*this").
Can anyone please tell me how to accomplish this properly with c++?
Thanks, John