Keil Logo

C51: USING LIBRARY FUNCTIONS

QUESTION

How do I use the library functions (putchar, _getkey, calloc, free, init_mempool, malloc and realloc) in my project?

ANSWER

The relevent source files for the library functions are located in the \lib folder inside the C51 installation.

First, the relevent source file must be included in the project. This is done by editing the project and adding the source file.

Second, the function prototype must be added to your source code with the extern keyword. This must be performed for each source file for which you wish to use the function. For example:

extern char _getkey();

The function may then be called.

MORE INFORMATION

FORUM THREADS

The following Discussion Forum threads may provide information related to this topic.

Last Reviewed: Friday, July 15, 2005


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.