Я продолжаю получать ошибку "Преобразование из строкового литерала в char * устарело" в моем коде. Целью кода является использование указателя-указателя для назначения string1 и string2 слова, а затем распечатка. Как я могу это исправить?
Вот мой код:
#include <iostream>
using namespace std;
struct WORDBLOCK
{
char* string1;
char* string2;
};
void f3()
{
WORDBLOCK word;
word.string1 = "Test1";
word.string2 = "Test2";
char *test1 = word.string1;
char *test2 = word.string2;
char** teststrings;
teststrings = &test1;
*teststrings = test2;
cout << "The first string is: "
<< teststrings
<< " and your second string is: "
<< *teststrings
<< endl;
}