Программы на C++. Форум разработчиков
-
Anonymous
На функцию E1776 «student::operator=(const Student &)» (объявленную неявно) нельзя ссылаться — это удаленная функция.
Сообщение
Anonymous »
Классы
Код: Выделить всё
#include
#include
using namespace std;
class student {
string name;
const string cnic;
const char gender;
float cgpa;
public:
student() : name(" "), cnic(" "), gender(' '), cgpa(0.0) {}
student(string cnic, char g) : cnic(cnic), gender(g) {}
string getname() const { return name; }
string getcnic() const { return cnic; }
char getgender() const { return gender; }
float getcgpa() const { return cgpa; }
void setname(const string& newname) { name = newname; }
void setcgpa(float newcgpa) { cgpa = newcgpa; }
};
class section {
student s[2];
string sectionname;
string teacher;
public:
section(): s() {}
void editsection();
void addstudent();
void updatestudent();
void printlist();
void printliststudents();
};
Основная функция
Код: Выделить всё
int main() {
section* ptr;
int size;
cout > size;
cout
Подробнее здесь: [url]https://stackoverflow.com/questions/78207366/e1776function-studentoperator-const-student-declared-implicitly-canno[/url]
1716210315
Anonymous
Классы
[code]
#include
#include
using namespace std;
class student {
string name;
const string cnic;
const char gender;
float cgpa;
public:
student() : name(" "), cnic(" "), gender(' '), cgpa(0.0) {}
student(string cnic, char g) : cnic(cnic), gender(g) {}
string getname() const { return name; }
string getcnic() const { return cnic; }
char getgender() const { return gender; }
float getcgpa() const { return cgpa; }
void setname(const string& newname) { name = newname; }
void setcgpa(float newcgpa) { cgpa = newcgpa; }
};
class section {
student s[2];
string sectionname;
string teacher;
public:
section(): s() {}
void editsection();
void addstudent();
void updatestudent();
void printlist();
void printliststudents();
};
[/code]
Основная функция
[code]
int main() {
section* ptr;
int size;
cout > size;
cout
Подробнее здесь: [url]https://stackoverflow.com/questions/78207366/e1776function-studentoperator-const-student-declared-implicitly-canno[/url]