Relative Content

Tag Archive for theory

Stack and heap – dynamic allocation question

Sources usually mention that dynamically created variables are allocated on the heap, while functions’ variables on the stack. Also the ones on the stack cease to exist automatically when e.g. the function which contains the variable exits. If I understand correctly, data fields of class are on the heap.
I do not understand, what is meant by ‘dynamic’? As I see it, when the code is running, anything being created is created dynamically on the fly, be it function variables or objects with variables inside them. I would be glad for simple explanation. Thanks

Class of problems solvable by sed or stream editors

I’ve came across a question transform this text with sed [sed only]
and it got me wondering what class of problems is solvable by stream editors or programs/computational models with similar constraints.