friend ostream operator ostream stream CDSList if eHead NULL cout The

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
friend ostream& operator<<(ostream& stream, CDSList &A){
if (A.eHead == NULL){
cout << "The list is empty" << endl;
}
else {
A.eCur = A.eHead;
int i = 1;
while (A.eCur != NULL){
cout << i << ":" << A.eCur->GetData().GetCircleArea() << " ";
A.eCur = A.eCur->GetNext();
i++;
}
cout << endl;
}
}