我有下面的代碼無疑需要,一些澄清在結構指針
我有一個函數如下,
void deleteNode(struct myList ** root)
{
struct myList *temp;
temp = *root;
...//some conditions here
*root = *root->link; //this line gives an error
*root = temp->link; //this doesnt give any error
}
所以就是這兩條線之間的差異,對我來說看起來是一樣的.. 的錯誤是,
error #2112: Left operand of '->' has incompatible type 'struct myList * *'
謝謝:)
你讀過什麼好的C編程書?看起來你並沒有很好地理解指針的概念,在這裏解釋它會花費太多的時間和空間。先仔細閱讀一本好的C編程書。 – 2012-04-13 06:28:40