Facebook
From Bistre Macaw, 5 Years ago, written in C++.
This paste is a reply to Untitled from Paltry Hog - go back
Embed
Viewing differences between Untitled and Re: Untitled
#include 
#include 

using namespace std;

string& and_(string& s, const string& s1, const string& s2) 
{
        if (s1.length()> s1.length())
        {
                for (int i = 0; i < s1.length(); i++)
                {
                        if (s1[i]==s2[i])
                        {
                                s += s1[i];
                        }
                }
                return s;
        }
        else
        {
                for (int i = 0; i < s2.length(); i++)
                {
                        if (s1[i] == s2[i])
                        {
                                s += s2[i];
                        }
                }
                return s;
        }
        
}
int main()
{
        char* str_temp = new char[255];
        string* s = new string[255];
        string s1 = "Hello";
        string s2 = "Hell";

        cout << and_(*s, s1, s2) << endl;
        return 0;
}

Replies to Re: Untitled rss

Title Name Language When
Re: Re: Untitled Sweltering Porcupine cpp 5 Years ago.
Re: Re: Untitled Cute Treeshrew cpp 5 Years ago.
Re: Re: Untitled Flying Pheasant cpp 5 Years ago.
Re: Re: Untitled Rude Butterfly cpp 5 Years ago.
Re: Re: Untitled Sludgy Peccary cpp 5 Years ago.