for an uni assignment I have to do the following: https://ibb.co/5WpMS0V (I cant upload a photo, the server is messed up or something)
What I've got so far is the following: Im trying to get all the characters that I need to put in, into an array but it's not working properly. Can anyone explain to me how to do this? Also, the subject this week is recursion, so I should make this with the use of recursion. If anyone knows how to get the characters in properly, then I know how to move on! Thanks in advance.
// libraries
#include <stdio.h> // endables input/output commands
#include <stdlib.h> // enables standard library of functions
// main
int main(int argc, char *argv[]) {
int numberOfRows;
int numberOfColoms;
scanf("%d %d", &numberOfRows,&numberOfColoms);
char matrix[numberOfRows][numberOfColoms];
char letter = getchar();
scanf("%c" , &letter);
do {
for (int i = 0; i < numberOfRows; i++) {
for (int j = 0; j < numberOfColoms; j++) {
scanf("%c" , &matrix[i][j]);
}
}
} while (letter != '\n');
for (int i = 0; i < numberOfRows; i++) {
for (int j = 0; j < numberOfColoms; j++) {
printf("%c" , matrix[i][j]);
}
}
return 0;
}