Пример взят из книги, там не было только строк с include и setlocale
#include <iostream>
#include <string>
#include <locale>
using namespace std;
const int max_len = 255;
class my_string {
public:
void assign(const char* st);
int length() const { return len; }
void print() const {
cout << s << "\n Длина: " << len << endl;
}
private:
char s[max_len];
int len;
};
int main() {
setlocale(LC_ALL, "Russian");
my_string one;
my_string two;
char three[40] = { "Меня зовут Чарльз Бэббидж." };
one.assign("Меня зовут Алан Тьюринг.");
two.assign(three);
cout << three;
cout << "\n Dlina: " << strlen(three) << endl;
if (one.length()<=two.length())
{
one.print();
}
else
{
two.print();
}
}
Ошибка: LNK2001 неразрешенный внешний символ ""public: void __thiscall my_string::assign(char const *)" (?assign@my_string@@QAEXPBD@Z)"
assign... – Harry Jul 13 '19 at 03:36