Pascal Triangle program in C
you don't free s which means you have a memory leak
*(begin+1) can be rewritten as begin[1], which is much clearer
1 char variable names are very hard to get into, use longer/descriptive names where needed


the entire function can be rewritten as

void pascal(int limit)
{

    int *row;
    row=(int*)malloc(2*sizeof(int));
    row[0]=1;
    row[1]=1;

    for(int n=3;n&lt;=limit+1;n++){

    printRow(buffer,n);

    int* nextRow = (int*)malloc((1+n)*sizeof(int));
    nextRow[0]=row[0];
    nextRow[n]=row[n-1];

    for(int i=1;i&lt;n;i++){
        nextRow[i]=row[i-1]+row[i];
    }
    free(row);
    row=nextRow;

    }
}


instead of the malloc->assign->free sequence I could have used realloc and then worked backwards:

row = (int*)realloc(row,(1+n)*sizeof(int));
row[n]=0;

for(int i=n;i&gt;0;i--){
    row[i]+=row[i-1];
}


but this is less clear