Возвращаемое значение пропущено: "strcmp"
У меня есть класс DVDdrive. В этом классе есть конструктор с параметрами. В теле конструктора лежит 3 strcmp. Там 3 предупреждения: Возвращаемое значение пропущено: "strcmp". Если попробовать запустить, то мне вернется в последние 3 параметра pc "Sony" с кучей символов "М", вместо того, что прописано по коду ("LG", "USB 2.0", "24x/24x/24x"). Хотя, вот, работаю с массивом чаров в соседних классах - и там все работает.. Не могу понять логику. В чем может быть проблема?
#include <iostream>
using namespace std;
// это омй класс
class DVDdrive {
private:
char manufacturer[20];
char interfce[20];
char speed_formula[20];
public:
DVDdrive(const char* manu, const char* inte, const char* sf) {
strcmp(manufacturer, manu);
strcmp(interfce, inte);
strcmp(speed_formula, sf);
}
void show_DVDdrive(void);
};
void DVDdrive::show_DVDdrive(void) {
cout << "Производитель -->> " << manufacturer << endl;
cout << "Интерфейс -->> " << interfce << endl;
cout << "Скоростная формула -->> " << speed_formula << endl;
}
// это тоже мой класс
class videocard {
private:
int GPU;
int MemorySize;
char CoolingSystem[20];
public:
videocard(int g, int ms, const char* cs) {
GPU = g;
MemorySize = ms;
strcpy(CoolingSystem, cs);
}
void show_videocard(void);
};
void videocard::show_videocard(void) {
cout << "Частота GPU -->> " << GPU << endl;
cout << "Система охлаждения -->> " << CoolingSystem << endl;
cout << "Объем памяти -->> " << MemorySize << " Гб" << endl;
}
class screen {
public:
screen(const char* t, long c, int x, int y) { //
strcpy(type, t);
colors = c;
x_resolution = x;
y_resolution = y;
}
void show_screen(void);
private:
char type[30];
long colors;
int x_resolution;
int y_resolution;
};
void screen::show_screen(void) {
cout << "Тип экрана: " << type << endl;
cout << "Количество цветов: " << colors << endl;
cout << "Распределительная способность: " << x_resolution << " x " << y_resolution << " y " << endl;
}
class mother_board {
public:
mother_board(int p, int s, int r) {
processor = p;
speed = s;
RAM = r;
}
void show_mother_board();
private:
int processor;
int speed;
int RAM;
};
void mother_board::show_mother_board(void) {
cout << "Процессор: " << processor << endl;
cout << "Частота: " << speed << endl;
cout << "ОЗУ: " << RAM << " Мб" << endl;
}
class computer : public screen, public mother_board, public videocard, public DVDdrive {
public:
computer(const char* n, int h, float f, const char* s, long c, int x, int y, int p, int sp, int r, int g, int ms, const char* cs, const char* manu, const char* inte, const char* sf) : screen(s, c, x, y), mother_board(p, sp, r), videocard(g, ms, cs), DVDdrive(manu, inte, sf) {
strcpy(name, n);
hard_disc = h;
floppy = f;
}
void show_computer(void);
private:
char name[50];
int hard_disc;
float floppy;
};
void computer::show_computer(void) {
cout << "Тип компьютера: " << name << endl;
cout << "Жесткий диск: " << hard_disc << " Мб" << endl;
cout << "Дискета: " << floppy << " Мб" << endl;
show_mother_board();
show_screen();
cout << "\nИнформация, которую я добавляю в класс computer (методичка) со своего класса videocard::::\n";
show_videocard();
cout << "\nИнформация, которую я добавляю в класс computer (методичка) со своего класса DVDdrive::::\n";
show_DVDdrive();
}
int main()
{
setlocale(0, "");
computer pc("Sony", 1024, 1.44, "SVGA", 64000000, 780, 1024, 686, 66, 1024, 255, 8, "активная", "LG", "USB 2.0", "24x/24x/24x");
pc.show_computer();
return 0;
}