先执行init_all();
另外不需要copy出来,直接打印lookupuser->numposts即可
【 在 linuxlab (小周) 的大作中提到: 】
: #include "bbs.h"
: int main (int argc, char *argv[])
: {
: struct userec *lookupuser;
: struct userec user;
: if (getuser("GNU", &lookupuser) == 0) {
: fprintf (stderr, "no such user\n");
: exit (-1);
: }
: user = *lookupuser;
: printf ("Numposts: %d\n", user.numposts);
: return 0;
: }
: 看了一下src/maintain.c里边好像也是这样做的,但是我这个程序执行时会有段错误。
--
FROM 128.12.150.*