是释放calloc(4,6)一样释放calloc(6,4)? [英] Is calloc(4, 6) the same as calloc(6, 4)?

查看:97
本文介绍了是释放calloc(4,6)一样释放calloc(6,4)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一个初学者C程序员,我认为这将是如此,但想了一些肯定,如果可能的。

I'm a beginner C programmer, and I assumed that this would be the case, but would like some affirmation if possible.

如果他们是一样的,为什么不采取一个参数呢?

If they are the same, why not just take one argument instead?

推荐答案

这是一样的。究其原因是因为大多数的时候你希望使用的sizeof 运营商作为参数之一。如果传递两个参数打扰你了,叫的malloc()里面有一个参数。

It is the same. The reason is because most of the time you want to use a sizeof operator as one of the arguments. If passing two parameters bother you, call malloc() which has a single argument.

这篇关于是释放calloc(4,6)一样释放calloc(6,4)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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