标签云

微信群

扫码加入我们

WeChat QR Code

记忆之间的区别是什么,缓冲区和堆栈?[重复]

This question already has an answer here:

While learnin c programming only the memory is mentioned. But in practice it seems that there is more; the buffer and stack words are almost there.

What is the difference between these terms? why they're very interesting?

Please, i need a detailed answer. Short answers can't serve. Also some resources may be helpful.

Tanks for advance.


In keeping with your request, I won't make this an answer, but in short the stack and buffers are specific places in memory. "The stack" is the function stack, a stack data structure that holds all local variables. Buffers can be used in various contexts in general they store temporary data that in then processed.

2018年05月27日15分38秒

You probably mean "heap" instead of "buffer". The former is always different from the stack. The latter is a chunk of memory.

2018年05月27日15分38秒

if this question was asked 7 years ago, it would have tons of upvotes, the hypocricy of this site is astonishing

2018年05月28日15分38秒

You teaching rullof how to search the internet? ;-)

2018年05月27日15分38秒

FiddlingBits:- When you see lines like Please, i need a detailed answer. Short answers can't serve. in question then you dont have the alternative other than this ;)

2018年05月27日15分38秒

How true, how true.

2018年05月27日15分38秒

RahulTripathi Tanks. Good with buffer. For the stack i know what is the principle of LIFO but i don't know what it has to do with program and the processing, what's the important to know about it.

2018年05月28日15分38秒

rullof:- Although I didnt get your point very clearly but I would tell you that IIRC compilers use stacks when checking things like if/else . Also commands in programming language like recursive method calls use a stack to order or precedence for each call

2018年05月27日15分38秒