为什么已经存在内存集等,为什么存在ZeroMemory等? [英] Why do ZeroMemory, etc. exist when there are memset, etc. already?

查看:104
本文介绍了为什么已经存在内存集等,为什么存在ZeroMemory等?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当C标准库中已经存在内存集和相关调用时,为什么 ZeroMemory()和Windows API中存在类似的调用?我应该打给谁?我猜答案是取决于。

Why does ZeroMemory(), and similar calls exist in the Windows API when there are memset and related calls in the C standard library already? Which ones should I call? I can guess the answer is "depends". On what?

推荐答案

在C和C ++中, ZeroMemory() memset()是完全相同的东西。

In C and C++, ZeroMemory() and memset() are the exact same thing.

/* In winnt.h */
#define RtlZeroMemory(Destination,Length) memset((Destination),0,(Length))

/* In winbase.h */
#define ZeroMemory RtlZeroMemory

为什么要使用 ZeroMemory()然后? 显而易见。但我更喜欢< C或C ++程序中的code> memset()。

Why use ZeroMemory() then? To make it obvious. But I prefer memset() in C or C++ programs.

这篇关于为什么已经存在内存集等,为什么存在ZeroMemory等?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆