- Function
Allocate a copy of a string on the heap.
- Header
- Declaration
char* __fastcall__ strdup (const char* s);- Description
strdupallocates a memory block on the heap, big enough to hold a copy ofsincluding the terminating zero. If the allocation fails,NULLis returned, otherwisesis copied into the allocated memory block, and a pointer to the block is returned.- Limits
- The function is only available as fastcall function, so it may only be used in presence of a prototype.
- It is up to the caller to free the allocated memory block.
- Availability
ISO 9899
- See also
- Example
None.