ChinaUnix.net
相关文章推荐:

结构体中的函数指针

struct evp_cipher_st { int nid; int (*do_cipher)(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, unsigned int inl);/* encrypt/decrypt data */ 省略..... } /* EVP_CIPHER */; 另外一个函数使用这个structure去调用了 do_cipher这个函数,单不知道do_cipher再哪里定义 已经试过的方法 1. 在根目录grep do_cipher * -nr 没有搜到有给该成员赋地址值的地方 2. 在...

by shanghai_jack - C/C++ - 2007-03-21 18:34:01 阅读(2577) 回复(2)

相关讨论

为何下面的代码看不到输出呢? 那里错了呢?望指教, 谢谢! [code] #include #include typedef struct { void (*func)(void); }struct_t; void fun(void); int main(int argc, char **argv) { struct_t s = {fun}; (s.func); exit(0); } void fun(void) { printf("yinshulei\n"); } [/code]

by 只爱殷澍蕾 - C/C++ - 2007-02-01 00:00:34 阅读(973) 回复(6)

如下的代码请高手解释:struct authstaticinfo { const char *auth_name; char * (*auth_func)(const char *, const char *, char *, int, void (*)(struct authinfo *, void *), void *); int (*auth_prefunc)(const char *, const char *, int (*)(struct authinfo *, void *), void *); void (*auth_cleanupfunc)(); int (*auth_changepwd)(const char *, /* servi...

by michealzoe - C/C++ - 2003-11-19 03:57:50 阅读(734) 回复(1)

#include #include typedef char INT8U; typedef long int INT32U; int pp( ) { printf("this is pp\n"); return 0; } int main() { void OSVectSet (INT8U vect, void (*)()); OSVectSet(7,(void (*)(void))pp); return 0; } void OSVectSet(INT8U vect, void (*addr)(void)) { INT32U *pvect; pvect = (INT32U *)(((INT32U)vect * 4) + 0x20000000) *pvect = (INT32U)addr; print...

by idleness - C/C++ - 2008-04-28 00:38:45 阅读(2786) 回复(10)

有一个结构 struct type {char disk[100]; int percent; }type1; char disk[100]里面是:/dev/cciss/c0d0p1 /dev/cciss/c0d0p2 none /dev/cciss/c0d0p3 /dev/cciss/c0d0p5 int percent里面是: 53 6 0 24 9 现在我想让用户手动输入磁盘的目录名,...

by superjimmy888 - C/C++ - 2009-02-27 23:16:03 阅读(810) 回复(2)

x y 584.7 324760.79 584.9 324510.99 585.2 323607.37 585.5 322668.48 585.7 321244.1 586 319438.84 typedef struct tagPOINT //定义点结构 {double x; double y; }POINT;

by w123456 - C/C++ - 2005-05-10 21:48:42 阅读(396) 回复(1)

看到一结构定义如下: struct { uint32 a:1; uint32 b:1; uint32 c:30; }AAA; 请教: uint32 a:1;的“:1”表示什么意思?

by huxiju - C/C++ - 2008-08-21 18:14:47 阅读(8180) 回复(20)

[code] typedef struct{ char a[5]; }A; typedef struct{ int b; }B; main(){ void *buf=malloc(30); memset(buf,0,30); A *a=(A*)buf; strcpy(a->a,"test"); B *b=(B*)(a+1); b->b=10;//想打印这个10 printf("%s\n",buf);//现在可以打印出test来,但我想打印出10,该怎么写? return; } [/code] 这代码是写着玩的。并非什么设计,只是偿...

by dxbh - C/C++ - 2008-06-02 16:10:09 阅读(1669) 回复(11)

我想修改结构内一个项目的值 如结构提定义为 struct xxx{ char aaa[2]; }yyy; 现在我想修改aaa内的值; 怎么修改, 用语句yyy.aaa="xxxx"; 好像不可以?

by jackwenghui - C/C++ - 2007-08-29 17:06:50 阅读(1245) 回复(8)

#include typedef struct data {     size_t uid;     size_t pos; } Employee; struct record {     char key[128];     Employee *emps;     unsigned int hash;     unsigned int total; }; struct db {     struct record *recs;     unsi...

by 我要思考 - C/C++ - 2008-05-03 12:30:33 阅读(5336) 回复(21)

也许题目没有说明白,我还是用代码说明吧,定义一个结构: struct no_str{ int user_no[100]; float pay_fee[100]; struct no_str *next; }; 这样的几个结构组成链表.现在想把整个链表的数据按照user_no来排序,因为可能涉及把一个结构数据移到到另一个结构,所以该怎么实现这个排序呢?如果为了方便排序需要稍微修改结构的话,也可以. 请大家赐教.

by ohwww - C/C++ - 2004-08-18 17:15:35 阅读(5473) 回复(29)