how to access malloc done inside a function in c code example Example: how to use malloc in c ptr = (castType*) malloc(size);