pub type WINDOW = *mut i8;
Run Code Online (Sandbox Code Playgroud)
一个用法WINDOW:
pub fn newwin(_:c_int,_:c_int,_:c_int,_:c_int) -> WINDOW;
Run Code Online (Sandbox Code Playgroud)
// 1:
typedef struct _win_st WINDOW;
// 2:
struct _win_st {
/* lots of fields... */
};
// 3:
(WINDOW *) newwin (int,int,int,int);
Run Code Online (Sandbox Code Playgroud)
为什么是这种类型的WINDOW *mut i8?
我正在读它作为指向C的指针char,这显然是不正确的.i8如果你没有在Rust中实现C结构,那么最好简单地说一个指针是类型的吗?这根本不重要吗?