cjw21
驱动牛犊
驱动牛犊
  • 注册日期2002-01-27
  • 最后登录2018-05-29
  • 粉丝0
  • 关注0
  • 积分4分
  • 威望20点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
  • 社区居民
阅读:1679回复:0

请教:va_list参数赋值

楼主#
更多 发布于:2002-03-08 10:34
我在PPC860上开发一个类似VC中CSTING的类,在FORMAT函数时遇到一个问题:就是我先定义一个FORAMT如下:
void Format(LPCTSTR lpszFormat, ...);
void FormatV(LPCTSTR lpszFormat, va_list argList);

void  CString::Format(LPCTSTR lpszFormat, ...)
{
    va_list argList;
    va_start(argList, lpszFormat);
    FormatV(lpszFormat, argList);
    va_end(argList);
}
void CString::FormatV(LPCTSTR lpszFormat, va_list argList)
{
     va_list argListSave;
  (1)   argListSave=argList;
    .......
}
 在(1)的地方老出现incompatible types in assignment of `{a
nonymous struct} *\' to `{anonymous struct}[1]\'
错误.
argListSave 和 argList都是va_list类型为什么会出现这样的问题,
我该怎么把argList的值赋给argListsave.

其中va_list的定义如下:
typedef struct {
  char gpr; /* index into the array of 8 GPRs stored in the
  register save area gpr=0 corresponds to r3,
  gpr=1 to r4, etc. */
  char fpr; /* index into the array of 8 FPRs stored in the
  register save area fpr=0 corresponds to f1,
  fpr=1 to f2, etc. */
  char *overflow_arg_area; /* location on stack that holds the next
  overflow argument */
  char *reg_save_area; /* where r3:r10 and f1:f8, if saved are stored */
} __gnuc_va_list[1];
请高手指教




虚心向高手学习,提供共享资源。
游客

返回顶部