Message from C, C++ discussions

December 2019

— Any benefits could be measured, i will not assume any, having not so much experience


And I'm talking only about these two cases, not vector:
int *heap = malloc(N bytes);
int stack[N elements];

— Allocating memory on a heap costs more than on a stack

— Not always

— Talk about custom allocators

— Almost always

— That isn't the benefit, that I wanted to know :D

I already noticed the stack pointer

— You can allocate a big heap and use chucks of it later

— Hi

— I creat a txt file and get information from this file with ifstream . I write in the txt file name of people and their length. I want compare their lenght or choose the bigger one . How can i do ?

Message permanent page

— Help please

— You write the code