Can you please tell me where i am making mistake in the code
#include
#include
#include
using namespace std;
bool sortGame(pair<string, int> p1, pair<string, int> p2)
{
if (p1.second > p2.second)
{
return true;
}
else if (p1.second == p2.second)
{
if (p1.first < p2.first)
{
return true;
}
else
{
return false;
}
}
else
{
return false;
}
}
int main()
{
int x,n;
cout << “Enter max salary:”;
cin >> x;
cout << “Enter number of the employees:”;
cin >> n;
pair<string, int> *p = new pair<string, int> [n];
cout << “Enter employee details:”<<endl;
for (int i = 0; i < n; i++)
{
string name;
int salary;
cin >> name;
cin >> salary;
p[i] = make_pair(name, salary);
}
sort(p, p + n,sortGame);
cout << “After sorting:” << endl;
for (int i = 0; i < n; i++)
{
if (p[i].second == x || p[i].second < x || p[i].second>100)
{
continue;
}
cout << p[i].first << " " << p[i].second<<endl;
}
cin.get();
system(“pause”);
return 0;
}