If you want to copy the contents of p into q use memcpy().