Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for (int i = 0; i < count; i++)
- {
- char* input1 = new (std::nothrow) char[20];
- char* input2 = new (std::nothrow) char[20];
- std::cin >> input1 >> input2;
- dictionary[i][0] = input1;
- dictionary[i][1] = input2;
- }
- =================================================================
- char check;
- char inputStr[100];
- char* p;
- do
- {
- std::cout << "String: ";
- getchar();
- std::cin.getline(inputStr, 100);
- p = replaceFromDictionary(inputStr, dictionary, count);
- std::cout << inputStr << " (" << strlen(inputStr) << ")-> " << p << "(" << strlen(p) << ")" << std::endl;
- delete[] p;
- std::cout << "Continue? [y/n]";
- std::cin >> check;
- system("cls");
- } while (check == 'y');
- for (int i = 0; i < count; i++)
- {
- delete[] dictionary[i][0];
- delete[] dictionary[i][1];
- }
- delete[] dictionary;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement