malloc tag

6 questions


1 answers
121 views
0
Which one should I use, malloc or new?

In C++, there are many ways to dynamically allocate, right?Then when should I use malloc and when should I use new?malloc If you finished freeIf new is done, deleteI know I shouldn't mix the two.


1 answers
132 views
0
Why can't I use alloca()?

As far as I know, alloca() dynamically allocates memory in stack, not heap, and releases memory on its own when it returns from routine Then shouldn't it be recommended because it's safer because it d...


1 answers
69 views
0
I have a question about malloc free order

Why is it that I have to do the reverse free for the malloc order?

1 years ago

1 answers
97 views
0
What is the difference between malloc and calloc?

The method of using both is similar, and the size of the return is the same, but why is there a separate one?I can't tell the difference between the two.

1 years ago

1 answers
125 views
0
There is a question about saving the array after entering the c language file.

Hello, I am a student who is learning programming in C language these days.One of the things you have to do is open the data.txt file and save it as an array and solve the problem using those arrays, ...

1 years ago

2 answers
57 views
0
The difference between C and C++ for (memory allocation for structures)

Hello, I'm a reserve who just got discharged from the military while preparing to return to school for the second semester of the second year of computer engineering.I was curious while looking at the...

1 years ago

© 2024 OneMinuteCode. All rights reserved.