I've got some internal variables I have to store, what kinds of things do I have to keep track of?
计算的时候需要占用多少内存,我需要存储一些内部变量,我需要记录哪些东西呢?
And by that, I mean, not how much memory do I need to store the size of the input, it's really how much internal memory do I use up as I go through the computation?
需要占用多少内存,我意思并不是,存储输入需要多少内存,而是当我完成这个?
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的操作符,其中括号里有一个参数,它会告诉我们,要存储一个类型的数据,需要占用多大空间。
应用推荐