Malloc will allocate 20 char of memory from the heap. Memset will set it to zeroes. "Name" will be copied there. Please note that you cannot use the type of quotes that you show. Use "".