utility functions the following utility functions are defined by ctypesaddressof(cobjreturns the memory address of cobj as an integer cobj must be an instance of ctypes type alignment(ctype_or_objreturns the integer alignment requirements of ctypes type or object ctype_or_obj must be ctypes type or an instance of type cast(cobjctypecasts ctypes object cobj to new type given in ctype this only works for pointersso cobj must be pointer or array and ctype must be pointer type create_string_buffer(init [size]creates mutable character buffer as ctypes array of type c_char init is either an integer size or string representing the initial contents size is an optional parameter that specifies the size to use if init is string by defaultthe size is set to be one greater than the number of characters in init unicode strings are encoded into bytes using the default encoding create_unicode_buffer(init [size]the same as create_string_buffer()except that ctypes array of type c_wchar is created get_errno(returns the current value of the ctypes private copy of errno get_last_error(returns the current value of the ctypes private copy of lasterror on windows memmove(dstsrccountcopies count bytes from src to dst src and dst are either integers representing memory addresses or instances of ctypes types that can be converted to pointers the same as the memmove(library function memset(dstccountsets count bytes of memory starting at dst to the byte value dst is either an integer or ctypes instance is an integer representing byte in the range - resize(cobjsizeresizes the internal memory used to represent ctypes object cobj size is the new size in bytes set_conversion_mode(encodingerrorssets the unicode encoding used when converting from unicode strings to -bit strings encoding is the encoding name such as 'utf- 'and errors is the error-handling policy such as 'strictor 'ignorereturns tuple (encodingerrorswith the previous setting lib fl ff