我想了解NCURSES源代碼並觸及錯誤點。該代碼如下:ncurses:警告:取消引用'void *'指針
#include<stdio.h>
struct screen {
void *_current_attr;
};
typedef struct screen SCREEN;
SCREEN * SP = ((void *)0);
int main(int argc, char **argv){
((*(SP)->_current_attr)) = (
((*((SP)->_current_attr))) &
~((~(1UL - 1UL)) << ((0) + 8))) | ((1UL - 1UL)
);
return 0;
}
我收到錯誤信息爲:
In function ‘main’:
warning: dereferencing ‘void *’ pointer
warning: dereferencing ‘void *’ pointer
error: void value not ignored as it ought to be
error: invalid use of void expression
我想知道什麼是錯誤和解決方案的原因吧?
沒有錯誤發生在哪一行?我認爲'main'的第一行? –
第13,14,15,16行錯誤 – Vineet1982
這就是'main'內部賦值語句的所有四行,對吧? –