Реферат: Программирование на С++
Текст программы.
#include
#include
#include
class stroka
{
char *ch;
int len;
friend int operator == (stroka & a , stroka & b);
friend stroka* Friend0(stroka c);
friend istream& operator >>(istream & in, stroka & a );
friend ostream& operator <<(ostream & out, stroka & a );
public :
stroka(int N=80)
{ch = new char [N];
ch[0]='\0';
}
stroka (const char *s)
{
int j=0;
while (ch[j++]);
ch = new char[len];
ch[len] = '\0';
len--;
for (int i=0;i
ch[i]= s[i];
}
void string1(void)
{ int j=0;
while (ch[j++]);
len = j-1;