Hello Guys !
I'm new user of C, I've been using it for a couple of months.
I have a question about the use of the comands to allocate and handle memory resources.
Like memset, malloc, and all these commands.
The question is when is necessary to start using them.
When we have very large arrays? Or we handle big amounts of information?
Thanks for the support.
Regards..
Memory Management
Started by batwings, Jan 30 2010 02:37 PM
4 replies to this topic
#1
Posted 30 January 2010 - 02:37 PM
|
|
|
#2
Posted 30 January 2010 - 02:43 PM
Yes. When you need them is when you need them.
And memset doesn't have anything to do with allocation.
And memset doesn't have anything to do with allocation.
#3
Posted 30 January 2010 - 03:12 PM
Thanks.
I've read that malloc is just to reserve a block of memory and memset is to manipulate that range of memory.
Right?
Regards..
I've read that malloc is just to reserve a block of memory and memset is to manipulate that range of memory.
Right?
Regards..
#4
Posted 30 January 2010 - 03:17 PM
Sure. a = 4 manipulates a block of memory too.
#5
Posted 30 January 2010 - 05:32 PM
Generally, you will use pointers when creating more advanced data structures (such as linked lists), to "pass by reference" instead of "pass by value", and when you are passing large structs into functions.


Sign In
Create Account

Back to top









