malloc, free, and snprintf
malloc, free, and snprintf
u dont have to rebuild them, u can find the code for that on the web, just recompile it with your native compiler.
ssharish
I've searched around on google and found out that it's not recommended to use dynamic memory allocation in mikroC due to hardware memory limitations. Thanks for your help anyway.
Last edited by stanlvw; 12-16-2007 at 10:22 PM.
I got this link from a book. You can get the source code for Standard C Library from here.
http://sourceware.org/newlib/
ssharish
I was referring to that the max number an uint can hold is 0xFFFFFFFF - in decimal, that is 4 294 967 295. I read... 10 digits. And since one byte is required for each digit in a string, that means the safest lowest amount of memory to allocate is 10 bytes for the numbers + 1 for '\0'. A few extra bytes of memory doesn't hurt that much I think.
It's better to be safe than sorry, especially if something bad happens or if you need higher numbers in the future.