So basically i got to make program where you can add rows, inside those rows numbers and count in each row and all rows pair number sum.
This far im done and everything is working. Now part which don't want work. I need make option to make rows longer or shorter. For example:
row1 contains 1,4,5,2,4
row2 contains 1,2,5
i want make row1 longer and add 6. row1 now will contain 1,4,5,2,6
so here is code i made so far:
case '3':{
clrscr();
row=0;
printf("\n Which row length you want change?");
flushall();
scanf("%hd",&row);
g=row-1; //this is for going to row[0] element
elemcount=lengthie[g]; //this count how much elements i got it my row currently
printf("\n%hd.row length now is %hd\n",g+1,lengthie[g]);
printf("For how much you want change row length??");
scanf("%hd",&change);
if (change=0){printf("Row length not changed");}
if (change<0){ newlenght=vecaisskaits-change;lengthie[g] = (short int) realloc(newlenght, sizeof(short int));}
if (change>0){ newlenght=elemcount+change;
lengthie[g] = (short int) realloc(newlenght, sizeof(short int));
for(q=elemcount;q=lengthie[g];q++){
printf("\n Insert %hd. row %d. element",g+1,q);
flushall();
scanf("%hd",&elements[g][q]);
}
} */
getch();
break;}
any sugestions?!