All pastes #123063 Raw Edit

Anonymous

public c v1 · immutable
·published 2006-08-09 02:52 UTC
rendered paste body
#include <stdio.h>#include <stdlib.h>#include <string.h>int main(){	int **array;	int i, j, rows, cols;	printf("\nEnter Number of Rows: ");	scanf("%d", &rows);	printf("\nEnter Number of Cols: ");	scanf("%d", &cols);		array = malloc(rows * sizeof *array);	for( i=0; i<rows; i++ ){		array[i]=malloc(cols * sizeof *array[i]);	}	for( i=0; i<rows; i++ ){		free(array[i]);	}	free(array);	return EXIT_SUCCESS;}