We've been told to design our own class for strings. I've sat down and managed everything so far but I've stumbled accorss something. We've been asked to implement a concat algo.
strings* strings::concat(strings *s)
{
char str[10];
for(int i=0; i<5;i++)
{
str[i]=m_psz[i];
}
for (int j = 0 ; j < 5 ; j++)
{
str[j+5] = strings.m_psz[j];
}
return s;
}
I've managed to write a main for it
s1 = new strings("hello");
s2 = new strings("world");
s3 = new strings("00000000000000000000000000000000000000000000000");
string *s3 = s1->concat(s2);
s3->print();
delete s1, s2,s3;
I know its imcompolete but its also driving me nuts.....any ideas?