请问几个函数的意义!

ww521 2003-03-11 04:57:49
今天侃了一段代码,里面有这么两个函数,不知道是做什么用的!
1.GlobalAlloc( )
2.menset( )
实在做SOCKET编程的时候遇到的,能否告知其作用以及函数的参数如何,,表示什么呢
?多谢
还有在用C++做SOCKET底层的编程时多线程的问题时怎么回事,有哪些资料可以参看!
...全文
25 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
yuanhen 2003-03-11
  • 打赏
  • 举报
回复


GlobalAlloc(标志,大小) 从堆中分配一个指定数量的空间
menset(地址,字符,大小) 把指定字节数的空间全部变为指定的字符




Frank001 2003-03-11
  • 打赏
  • 举报
回复
1.GlobalAlloc( )

The GlobalAlloc function allocates the specified number of bytes from the heap. Win32 memory management does not provide a separate local heap and global heap.

This function is provided only for compatibility with 16-bit versions of Windows.

HGLOBAL GlobalAlloc(
UINT uFlags, // allocation attributes
DWORD dwBytes // number of bytes to allocate
);

2、menset( )->memset()

Sets buffers to a specified character.

void *memset( void *dest, int c, size_t count );

Kevin__Li 2003-03-11
  • 打赏
  • 举报
回复
1估计是自己实现的与内存分配有关的函数(UNIX下没有这个库函数,WINDOWN下不知道)

2应该是memset()吧,
The memset() function copies the value of the byte specified by the c
parameter, which is converted to an unsigned char, into each of the first n
locations of the string pointed to by the s parameter.

24,855

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 工具平台和程序库
社区管理员
  • 工具平台和程序库社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧