malloc sizeof So, when I call malloc size of int and int on this system is probably 4 bytes or 32 bits so what am I getting back?
所以,当我调用,在这个系统中int可能是4个字节,或者说32位,那么返回的是什么呢?
So let me go ahead and rerun sizeof and hit Enter.
我们继续然后返回sizeof,敲Enter键。
Let's go ahead and run sizeof.
接着运行“run,sizeof“
So let's go ahead and make sizeof.
让我们继续编译“make,sizeof“
And I don't quite remember from reading or from class how big these things are, well, it turns out -- and this is sometimes useful, later on more likely than now -- but C has a size of operator that takes an argument in parenthesis and it will tell you how much space is used to store that particular data type.
我不太记得类中的这些类型,是多大的,嗯,结果是--这个在以后比现在,可能是更有用的--不过C语言中有个sizeof的操作符,其中括号里有一个参数,它会告诉我们,要存储一个类型的数据,需要占用多大空间。
应用推荐