typedef struct {
int val;
struct MyLinkedList *next;
} MyLinkedList;
這樣的寫法 應該跟 一般寫node是等價?
void myLinkedListDeleteAtIndex(MyLinkedList* obj, int index) {
if(myLinkedListGet(obj,index)==(-1)){return ;}
int i=0,I=index;
MyLinkedList* K=myLinkedListCreate();
if (obj!=NULL)
{
if(I-1>0){myLinkedListDeleteAtIndex(obj->next,I-2);}
if(I==0){if((obj->next->next!=NULL)(obj->next=obj->next->next;)
這邊他很像對我call obj->next->next很有意見....要如何處理orz
else((MyLinkedList*)(obj->next)=K)
}
}
順便問 obj->next的type是MyLinkedList還是MyLinkedList*@@
似乎不給過