C++ basic Class and pointer

class Activity{

public:

 int start_time;
 int end_time;

};

bool compare(Activity* A,Activity* B){

 return A->end_time < A->nd_time;

}

int main(){

int test_case;
cin>>test_case;

while(test_case–){

    int tasks;
    cin>>tasks;
    Activity *A = new Activity[tasks];

    for(int i=0;i<tasks;i++){
        cin>>A[i].start_time ;
        cin>>A[i].end_time ;
    }

    sort(A,A+tasks,compare);

}
}

it give errror

@khemchandrs
change your compare function to

bool compare(Activity a, Activity b){
	return a.end_time < b.end_time;
}

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.