13.07.2015 Views

pcp_reference_guide_v2.5 - Tasking

pcp_reference_guide_v2.5 - Tasking

pcp_reference_guide_v2.5 - Tasking

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Libraries2−33Next functions convert the initial portion of the string *s to a long, longlong, unsigned long and unsigned long long respectively. Basespecifies the radix. *endp will point to the first character not used by theconversion.Stdlib.hlong strtol (*s,**endp,base)long long strtoll(*s,**endp,base)unsigned long strtoul(*s,**endp,base)unsigned long long strtoull(*s,**endp,base)Wchar.hlong wcstol (*s,**endp,base)long long wcstoll(*s,**endp,base)unsigned long wcstoul(*s,**endp,base)unsigned long long wcstoull(*s,**endp,base)Random number generationrandsrand(seed)Returns a pseudo random integer in the range 0 toRAND_MAX.Same as rand but uses seed for a new sequence ofpseudo random numbers.Memory managementmalloc(size)calloc(nobj,size)free(*ptr)realloc(*ptr,size)Allocates space for an object with size size.The allocated space is not initialized. Returns apointer to the allocated space.Allocates space for n objects with size size.The allocated space is initialized with zeros.Returns a pointer to the allocated space.Deallocates the memory space pointed to by ptrwhich should be a pointer earlier returned by themalloc or calloc function.Deallocates the old object pointed to by ptr andreturns a pointer to a niew object with size size.The new object cannot have a size larger than theprevious object.• • • • • • • •

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

Saved successfully!

Ooh no, something went wrong!