Home/Support/Support Forum/could anyone show me an example of the malloc() command aplication in dynamic c?
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

could anyone show me an example of the malloc() command aplication in dynamic c?

0 votes
I'm having trouble with the configuration and aplication of the malloc() function and other memory allocation commands in Dynamic C. I have some experience with the structure in C/C++, but it isn't working with the Rabbit programming language.

Thank you.
asked Jun 10, 2013 in Rabbit by fpborges New to the Community (2 points)

Please log in or register to answer this question.

1 Answer

0 votes
It depends on the version of Dynamic C you are using. If you are using DC9.62 for Rabbit 2000/3000 there are no malloc/free functions.

If you are using DC10.72 for Rabbit 4000 and newer the functions are there. You can see the function description for malloc by going to Help - Function Lookup and typing in malloc:

malloc <stdlib.h>

SYNTAX: void far *malloc( size32_t size)

DESCRIPTION: Allocates space for an object.

PARAMETER 1: Size of the object, in bytes.

RETURN VALUE: Address of space allocated. If there isn't enough memory
available, exits the program with an -ENOMEM error.

SEE ALSO: calloc, realloc, free,
_root_malloc, _root_calloc, _root_realloc, _root_free
answered Jun 25, 2013 by trooper2 Veteran of the Digi Community (589 points)
...