プログラムのこの最後の部分について本当に助けが必要です。より大きな文字列内で文字列を見つける必要があり、見つかった場合は部分文字列の開始位置を返します。方向から:
文字列の位置は 0 から始まり、長さ -1 で終わることに注意してください。文字列が見つからない場合は、値 -1 が返されます。
開始して、次のコードをコンパイルします。これが実際に正しいかどうかを知りたいだけです。あまり頭を悩ませたくはありませんが、専門家からのフィードバックが必要です。私はこれを正しく行っていますか?または、少なくとも正しい方向に進んでいますか?
const int MyString::Find(const MyString& other)
{
    int start(0);
    int counter(0);
    int end = other.Size;
    int count(0);
    int end1 = Size;
    int nfound = -1;
    char* temp;
    if(other.String[0] != '\0' && other.String[0] != ' ')
    {
        if(other.String[count] == String[counter])
        {
            start = counter;
            for(int i = count; i < end-1;i++)
            {
                for(int j = counter; j < end1 -1; j++)
                {
                    temp[j] = String[j];
                }
            }
            if(other == temp)
            {
                return start;
            }
            else
                return nfound;
        }
        else{
            while(other.String[count] != String[counter])
            {
                counter++;
                if(other.String[count] == String[counter])
                {
                    start = counter;
                    for(int i = count; i < end-1;i++)
                    {
                        for(int j = counter; j < end1 -1; j++)
                        {
                            temp[j] = String[j];
                        }
                    }
                    if(other == temp)
                    {
                        return start;
                    }
                    else
                        return nfound;
                }
            }
        }
    }
    else
    {
        return nfound;
    }
}