Where is the error in the code and how to fix it?

Code
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <fstream>
#include <iomanip>
using namespace std;
class CONTRY
{
 char* name;
 double temp_summer = 0, temp_autumn = 0, temp_winter = 0, temp_spring = 0;
public:
 CONTRY() { name = NULL; temp_summer, temp_autumn, temp_winter, temp_spring; };
 CONTRY(char*, double, double, double, double);
 ~CONTRY() { delete[]name; }
 CONTRY& operator=(const CONTRY& p);
 char* getname() { return name; }
 double gettemp_winter() { return temp_winter; }
 double gettemp_spring() { return temp_spring; }
 double gettemp_summer() { return temp_summer; }
 double gettemp_autumn() { return temp_autumn; }
 friend ostream& operator<<(ostream& s, const CONTRY& p);
 friend istream& operator>>(istream& s, CONTRY& p);
 COUNTRY(const COUNTRY&);
};
COUNTRY::COUNTRY(char* aname, double atemp_winter, atemp_spring double, double atemp_summer, double atemp_autumn)
{
 int n;
 n = strlen(aname);
 name = new char[n + 1];
 strcpy(name, aname);
 temp_winter = atemp_winter;
 temp_spring = atemp_spring;
 temp_summer = atemp_summer;
 temp_autumn = atemp_autumn;
}
COUNTRY::COUNTRY(const COUNTRY& p)
{
 int n = strlen(p.name);
 name = new char[n + 1];
 strcpy(name, p.name);
 temp_winter = p.temp_winter;
 temp_spring = p.temp_spring;
 temp_summer = p.temp_summer;
 temp_autumn = p.temp_autumn;
}

CONTRY& CONTRY::operator=(const CONTRY& p)
{
 if (this != &p)
{
delete[]name;
 name = new char[strlen(p.name) + 1];
 strcpy(name, p.name);
 temp_winter = p.temp_winter;
 temp_spring = p.temp_spring;
 temp_summer = p.temp_summer;
 temp_autumn = p.temp_autumn;
}
 return *this;
}
ostream& operator<<(ostream& s, const CONTRY& p)
{
 s << p.name << setw(17) << p.temp_winter << setw(21) << p.temp_spring << setw(10) << p.temp_summer << setw(10) << p.temp_autumn << setw(10);
 return s;
}
istream& operator>>(istream& s, CONTRY& p)
{
 lol char[100];
 s > > > > lol >> p.temp_winter >> p.temp_spring>>p.temp_summer>> p.temp_autumn;
 int n = strlen(lol);
delete[]p.name;
 p.name = new char[n + 1];
 strcpy(p.name, lol);
 return s;
}

int main()
{
 setlocale(LC_ALL, "Russian");
 CONTRY *a[100];
 int n, i;
 cout << "Enter no of countries: ";
 cin >> n;
 cout << "the COUNTRY,in the WINTER,SPRING,SUMMER AND AUTUMN: ";

 for (i = 0; i < n; i++)
 cin >> a[i];
 cout << "the name of the product | Average work time | Cost|\n";
 for (i = 0; i < n; i++)
 cout << a[i] << "\n";
 int winter = a[0]->gettemp_winter();
 int summer = a[0]->gettemp_summer();
 for (i = 0; i < n; i++)
{
 if (winter < a[i]->gettemp_winter())
 winter = a[i]->gettemp_winter();
 if (summer > a[i]->gettemp_summer())
 summer = a[i]->gettemp_summer();

}
 for (i = 0; i < n; i++)
{
 if (a[i]->gettemp_winter() == winter)

 cout << "COUNTRY WITH the MOST WARM in the WINTER \n" << a[i]->getname << "TEMPERATURE in WINTER is =" << winter << endl;
 if (a[i]->gettemp_summer() == summer)
 cout << "COUNTRY WITH THE COLDEST SUMMER \n" << a[i]->getname << "TEMPERATURE =" << summer << endl;
}


system("pause");
}
April 3rd 20 at 17:43
2 answers
April 3rd 20 at 17:45
Solution
spoiler
All of the census...

Замена1 (as said above):
CONTRY *a[100];
on
CONTRY* a = new CONTRY[100];

Замена2 in main starting here:
int winter = a[0]->gettemp_winter();
 int summer = a[0]->gettemp_summer();
...
On
 int winter = a[0].gettemp_winter();
 int summer = a[0].gettemp_summer();
...etc.

Now you have a pointer to an array and not an array of pointers, so that all> change .
thank you very much!!!!
yesterday I tried> to replace . but to me why it is still underlined in red
but today, everything is OK!!!))))) - deborah_Thompson38 commented on April 3rd 20 at 17:48
April 3rd 20 at 17:47
what you have to do in order to fix the bug yourself, Valerie? here, of course, there are men who will not break off to unwind your kite, but clear tale which crosses chalitsya first year, squarethese about these big carts without any additional information heated with your hand beneath one's dignity.
in the meantime, based on the information provided in General I would suggest to replace the unit of code generation.
Valeria a higher power does not reward intelligence unfortunately - deborah_Thompson38 commented on April 3rd 20 at 17:50
@deborah_Thompson38, but the error text and the version of software for writing programs you add to the question, okay? brain stress simple, and others the answer will become much easier.
it is possible and without it, of course; and I admit that even there He was the one who will overcome all obstacles on the way to the correct answer to your question... - Yasmin commented on April 3rd 20 at 17:53
@Yasmin, I would have written immediately about the error text, what's with all the hostility in the style of "I tread zone"? Burdened with intelligence? - Freeman commented on April 3rd 20 at 17:56
@Freeman, to make you excited here. - Yasmin commented on April 3rd 20 at 17:59
@Yasmin, nothing useful from this comment to make it is impossible. You can only provoke the questioner had nothing more to inquire, and a bunch of negativity in his address. This is a clear explanation. - Freeman commented on April 3rd 20 at 18:02
@Freeman, then do as necessary. - Yasmin commented on April 3rd 20 at 18:05
@Yasmin, would be a moderator would do as it should. - Freeman commented on April 3rd 20 at 18:08
@Freeman, and... well, then don't. - Yasmin commented on April 3rd 20 at 18:11

Find more questions by tags C++