i am looking to create a simple spreadsheet application where users are allowed to customize the rows and columns based on their input.
for example user inputs, newSS 10 9
which means user wants to create a newSpreadSheet of 10 columns and 9 rows.
an empty spreadsheet should be created and displayed in the console window.
the catch here is that there will always be an extra row and column for which the user has entered as the extra rows and columns are for the headers.
so 10 columns and 9 rows will have 11 columns and 10 rows stored in a 3D array because the first index of every column and row are the headers. it should look something like this.
first row would show: A B C D E F G H I J
first column would show: 1 2 3 4 5 6 7 8 9
as their labels
the spaces in between are their paticular index say A1, A2, B4 etc.. which the user can then edit the values inside.
can anyone teach me how to get started? am a very new c programmer here. am facing some issues with the codes. am able to create a 2d array but i need to alter the first row and first column to print it as the header according to how many rows and columns the users wants. so if 5 columns it will be (A-E)
WORKSHEET *ws_new(int cols, int rows) {
//return NULL;
int r;
int c;
int n[rows][cols];
for (r=1;r<=rows;r++)
{
for(c=1;c<=cols;c++)
{
//printf("%d",cols);
n[r][c]=0;
printf("%d", n[r][c]);
}
printf("\n");
}
}