Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

malloc

#include <stdio.h>
#include <stdlib.h>

char *create_array(unsigned int, char);

/**
 * main - check the code .
 *
 * Return: Always 0.
 */
int main(void)
{
	char *buffer;
	unsigned int size;

	size = 0;
	buffer = create_array(size, 'H');
	if (buffer == NULL)
	{
		printf("failed to allocate memory
");
		return (1);
	}
	free(buffer);
	return (0);
}
Source by s3.amazonaws.com #
 
PREVIOUS NEXT
Tagged: #malloc
ADD COMMENT
Topic
Name
1+3 =