I cannot find my mistake(s), in the following piece. I assume there is something wrong with the reading, I commented out what I tried:
char **A; // pointers for the matrices
    int n, m;
    scanf("%d", &n);
    scanf("%d", &m);
    A = (char **) malloc(sizeof(char *) * n);
    if (A == NULL)
        exit(1);
    for(i=0; i < n; i++){
        A[i] = (char *)malloc(sizeof(char) * m);
        if (A[i] == NULL)
            exit(1);
    }
    for(i=0; i < n; i++){
        for(j=0; j < m; j++){
            scanf("%c", &A[i][j]);
            // A[i][j] = getchar();
            // getchar();
        }
    }
    for(i = 0; i < n; i++){
        for(j = 0; j < m; j++){
            // printf("[%d][%d]", i, j);
            printf("%c", A[i][j]);
        }
        printf("\n");
    }
 
     
    