Добавил:
Angel_of_Death
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз:
Предмет:
Файл:
// Lab2.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "my_string.h"
#include <string>
#include <iostream>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
my_string str;
cout << "Enter the string:\n";
char st[100];
char act[3];
cin >> st;
str.setStr(st);
cout << "\n=============================================\n";
cout << "+ - string concatenation\n";
cout << "++ - converting string characters to lowercase characters\n";
cout << "\n=============================================\n";
char a = 'y';
while (a == 'y')
{
cout << "Enter the action:\n";
cin >> act;
my_string St;
if (!strcmp("+", act))
{
cout << "Enter the string:\n";
cin >> st;
St.setStr(st);
str + St;
str.print();
}
else
{
if (!strcmp("++", act))
{
++str;
str.print();
}
else
{
cout << "no action for strings\n";
}
}
cout << "Do you want to continue? (y/n)\n";
cin >> a;
}
return 0;
}