成员函数(reverseString()
)必须旋转字符串,但是当我创建并尝试在成员函数(char *temporary = stringo;
)中初始化新指针时,显然它看不到该成员。类(虽然不是全部代码)。
#include"Header.h"
#include<iostream>
using namespace std;
Stringfuncs::Stringfuncs(char *string)
{
this->stringo = string;
}
int Stringfuncs::lengthString()
{
int counter = 0;
for (int i = 0; stringo[i]; i++) { counter++; }
return counter;
}
char Stringfuncs::*reverseString() //this function doesn't see the member of the class
{
char *temporary = stringo; //identifier "stringo" isn't defined
}