0
我的助理教授課程來源於兩個班級:enseigner班級(來自個人)和PHD學生(來自學生班級和來自peronal的學生班級dervie) 我收到以下錯誤會員nci的請求含糊不清
「的成員NCI要求不明確」
NCI是個人
enter code here
#include<iostream>
using namespace std;
#include "enseigneer.h"
#include "assistant_professor.h"
#include "associate_professor.h"
#include "professor.h"
void assistant_delete(assistant_professor**head_assis,assistant_professor **tail_assis)
{
int number;int pos=0;int sz=0;
assistant_professor *temp;
assistant_professor *search_1;
assistant_professor *current;
assistant_professor *to_free;
temp=*head_assis;
current=*head_assis;
cout<<"Enter the CIN number of the enseigner that you want to delete\n ";
cin>>number;
if(head_assis==NULL)cout<< "The list is empty you have to enter data first\n";
else
{
while (search_1!=NULL)
{
search_1=search_1->next;sz=sz+1;
}
if ((*head_assis)-> nci==number)
{
to_free=*head_assis;
(*head_assis)=(*head_assis)->next;
delete (to_free);
cout<< "\nThe student was deleted\n";
}
else if ((*tail_assis)->nci==number)
{
for (int i=0;i<sz-3;i++)
current=current->next;
delete(current->next);
current->next=NULL;
*tail_assis=current;
cout<< "\nThe enseigner was deleted\n";
}
else
{
{
while((temp!=NULL) and ((temp->nci)!=number))
{
temp=temp->next;pos=pos+1;
}
if (temp->next==NULL) cout<<"Please pay attention the enseigner you've entred doesn't exist in the list\n";
else
{
for (int i=0;i<pos-1;i++)
current=current->next;
to_free=current->next;
current->next=current->next->next;
delete(to_free);cout<< "\nThe enseigner was deleted\n";
}
}
它是含糊不清的,因爲你的助理教授有兩個個人類型的基礎子對象。但是你忘了問一個問題。 –
的問題是如何解決錯誤,這是一個多重負擔! 「請求會員nci不明確」 – user3136456