11.07.2015 Views

PicC 9.50 dsPIC Manual.pdf

PicC 9.50 dsPIC Manual.pdf

PicC 9.50 dsPIC Manual.pdf

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Library FunctionsSTRDUPSynopsis#include char * strdup (const char * s1)DescriptionThe strdup() function returns a pointer to a new string which is a duplicate of the string pointed toby s1. The space for the new string is obtained using malloc(). If the new string cannot be created, anull pointer is returned.Example#include #include voidmain (void){char * ptr;}ptr = strdup("This is a copy");printf("%s\n", ptr);Return ValuePointer to the new string, or NULL if the new string cannot be created.205

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!