Chinaunix

标题: 菜鸟问题求教 [打印本页]

作者: zwvigour    时间: 2005-07-05 15:56
标题: 菜鸟问题求教
DB_CreateEntry(
    sbyte    *pMagicMarkup,
    void     *pDataObject,
    DataType iDataType,
    Access   Permissions,
    Access   ReadLvl,
    Access   WriteLvl,
    RLSTATUS (*p_funcValid) (struct environment *, void *),
    void     (*p_funcReadPrim)(environment *, void *, void *, char *),
    RLSTATUS (*p_funcWritePrim) (environment *, void *, void *, ...),
    StrcDes  *p_sdrStructDesc,
    Counter  StructOffset     )
请教上面这个函数定义中的
RLSTATUS (*p_funcWritePrim) (environment *, void *, void *, ...)
中的...表示什么意思,是不是表示这个参数有可能不止environment *, void *, void *?
作者: skybluehacker    时间: 2005-07-05 16:31
标题: 菜鸟问题求教
应该是...跟常用的
int wprintf(   const wchar_t *format [,argument]... );
差不多。
作者: toiby    时间: 2005-07-05 16:34
标题: 菜鸟问题求教
RLSTATUS (*p_funcWritePrim) (environment *, void *, void *, ...)
应该是一个指向一个形参不定长函数的函数指针
作者: kernelxu    时间: 2005-07-05 16:35
标题: 菜鸟问题求教
...表示函数的参数个数不定,但不一定只是environment *, void *, void *这些类型。
C中有一类的像这种参数个数不定的函数,最典型的如:
int      _Cdecl printf   (const char *format, ...);
int      _Cdecl scanf    (const char *format, ...);
int      _Cdecl sprintf  (char *buffer, const char *format, ...);
int      _Cdecl sscanf   (const char *buffer, const char *format, ...);
int      _Cdecl fscanf   (FILE *stream, const char *format, ...);
int      _Cdecl fprintf  (FILE *stream, const char *format, ...);
int        _Cdecl execl(char *path, char *arg0, ...);
int        _Cdecl execle(char *path, char *arg0, ...);
int        _Cdecl execlp(char *path, char *arg0, ...);
int        _Cdecl execlpe(char *path, char *arg0, ...);
int        _Cdecl spawnl(int mode, char *path, char *arg0, ...);
int        _Cdecl spawnle(int mode, char *path, char *arg0, ...);
int        _Cdecl spawnlp(int mode, char *path, char *arg0, ...);
int        _Cdecl spawnlpe(int mode, char *path, char *arg0, ...);

可以找相关的书了解一下,我对这方面也不是很熟。
作者: Paranoia    时间: 2005-07-05 18:10
标题: 菜鸟问题求教
RLSTATUS (*p_funcWritePrim) (environment *, void *, void *, ...)
这样在函数内怎么使用形参?




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2