Public feed #600268

Something

public c v1 · immutable
Raw Edit
·published 2007-07-02 18:51 UTC
rendered paste body
#include <stdio.h>#include <stdlib.h>#include <string.h>int main(void){    char string[256] = { 0 };    char *pstring[10] = { NULL };    int index = 0;            while(*fgets(string, sizeof string, stdin) != '\n')    {        pstring[index] = (char *)malloc(sizeof string);        strcpy(pstring[index++], string);    }        for(int i = 0; i < index; i++)    {        printf("%s", pstring[i]);        free(pstring[i]);    }            return 0;}