ChinaUnix.net
相关文章推荐:

void 分配内存

RT,请大家帮忙下! 谢谢!

by cheng_lai_shun - C/C++ - 2008-05-10 15:31:56 阅读(2215) 回复(9)

相关讨论

调用void free()函数,有没有办法知道它是否释放内存成功? 因为free()的返回值是void,是不是就没有办法通知它是否释放内存成功呢?

by dozec - C/C++ - 2005-09-30 08:33:54 阅读(3350) 回复(4)

在C和C++里,有时候看到源码中调用函数前加上“void”,不知道有什么作用,即 (void)function(argument) 这只是单纯为了形式的规整吗?请教诸位

by hoverlee - C/C++ - 2006-07-12 21:00:37 阅读(1233) 回复(9)

有个函数int A(..., ..., void *buf),想在函数里面跟据情况在buf中返回不同长度、不同类型的一段空间,有没有问题???请问大家。

by eikes - C/C++ - 2005-12-15 19:24:52 阅读(1025) 回复(2)

void hello(void*arg) { char*kk="hello"; arg=(void*)kk; return NULL; } main() { void*k; hello(k); char *k2=(char*)k; printf("%s",k); exit(0); } when running ,I get 8Z@ ,not hello,why? thanks for looking at my question

by lrh_0_2000 - C/C++ - 2005-09-09 17:49:32 阅读(1211) 回复(5)

看到有些人对void指针不太清楚,我就试着解释一下,权当抛砖引玉。 大家都知道int *pint是定义了一个指针变量,这个变量里面放的是一个地址,而这个地址里面放的是一个int型的数值。char *pchar是定义了一个指针变量,这个变量里面放的是一个地址,而这个地址里面放的是一个char型的数值。 以此类推……我们也知道在32位计算机上,一般sizeof(pint)是4,也就是说指针变量p的大小是4个字节,每个地址用32位来表示。我们还...

by lenovo - C/C++ - 2003-12-19 16:30:52 阅读(5901) 回复(2)

Default constructor called. Default constructor called. Default constructor called. Default constructor called. Destructor called. Constructorl called. Destructor called. Constructor2 called. Destructor called. x=0,y=0 x=5,y=0 x=3,y=-858993460 Destructor called. Destructor called. Destructor called. Press any key to continue #include; class B { int x,y; public: B(); B(int i); B...

by 雪花啤酒 - C/C++ - 2003-12-11 11:00:37 阅读(701) 回复(0)

在头文件中。typedef void _void; extern int func(_void); 此时将报错,说_void的用法不正确。 而直接写 extern int func(void); 则正常。 g++ 4.2。 不知道为什么。 谢谢。

by Xorcerer - C/C++ - 2009-08-31 21:10:50 阅读(2235) 回复(9)

在linux中函数asmlinkage void __init start_kernel(void)申明的意思?

by sc_px_jiangyun - 内核/嵌入技术 - 2006-03-06 11:58:11 阅读(830) 回复(1)

一个低级的问题:如果函数的定义是:int checkpass(void);那么就说明调用这个函数时不用向其中传入任何参数了吧。 而(void*) a指的就是变量a的地址吧。 请问这么理解正确吗?谢谢各位的回答

by lmingcsce - C/C++ - 2009-08-28 00:48:39 阅读(1259) 回复(3)

代码先上: stdafx.h -------------------------------------stdafx.h---------- #include #include #include #include #include #include #include #include #include using namespace std; class teststatic { public: int a; int b; teststatic(){} ~teststatic(){} void *fun(void *pvoid); create(); }; void *tests...

by lsupper - C/C++ - 2009-03-20 14:49:05 阅读(5429) 回复(11)