Q:

Getting a single character out of a string array in C

Let's say that i have an array of strings that looks like this:
Alphabet
As you can see, this is the alphabet represented with #.
The aim of the program is to show a letter (that comes from an input) using #.
So if input = E , i will have to print E
If a letter is not beetwen [a-z] or [A-Z], i have to print a question mark(made with #).
We are given T: the message to code H: the height of the letter(number of rows), L: the lenght of letters, and ROW:the sequence of rows that create the alphabet with #.
So i actually got a part of the program already coded.
But my problem is not how to sort this out.
The fact is that i've just learned pointers(basic use) and i don't understand how to handle them in a more complex(for me, it's complex), way.
#include <stdlib.h>
#include <stdio.h>
#include <string.h>

/**
 * Auto-generated code below aims at helping you parse
 * the standard input according to the problem statement.
 **/
int main()
{
    int L;
    scanf("%d", &L); fgetc(stdin);
    int H;
    scanf("%d", &H); fgetc(stdin);
    char T[257];
    fgets(T, 257, stdin);

    char elements[H][sizeof(T)];
    char *pointer, *Pelements[H];

    pointer = T;

    for (int i = 0; i < H; i++) {

        char ROW[1025];
        fgets(ROW, 1025, stdin);
        // given by the program

        strcpy(elements[i], ROW);
        Pelements[i] = &elements[i];
        // now i got the address of every first character of a string
    }

    while(*pointer != '\0'){
      if(*pointer >='a' && *pointer <= 'z' || *pointer >='A' && *pointer <= 'Z'){
        int temp= ((*pointer) - 'A');
        if(temp <= 25){
          for(int i=0; i<H; i++){
            int index= temp*L; // getting the position where to start to print
            for(int j=0; j<L; j++){
              printf("%s " , *Pelements+index);
              Pelements[i]++; //could have used index++
            }
          }
        }
      }
      else{
          printf("?");
      } 
      pointer++;
    }
    return 0;
}

The program is not completed ( i didn't handle [a-z]) in fact i'm testing it only with uppercase letters.
THE PROBLEM:
It keeps returning "segmentation fault", or giving me # in random positions. 
Thank you in advance.

A:

If I have understood what are you trying to accomplish, most of your code is pretty useless. This:
#include <stdio.h>
#include <stdlib.h>

#define BUFSIZE 128

int main()
{

    char *ROW[5] = {
        " # ##  #### ###### ### #### ### ##  # #### # ##  # ##  ###### ## ## ## ## #######   ",
        "# ## ##  # ##  #  #  # # #   ## ##  #### ## ## ## ## ##   # # ## ## ## ## #  #  #   ",
        "##### #  # ### ## # #### #   ### #  #### ## ### # ###  #  # # ## #### #  #  #  ##   ",
        "# # ###  # ##  #  # ## # # # ## ##  # ## ## ##   ### #  # # # ## ##### # # #        ",
        "# ###  #### ####  #### #### # # ##### ## # # #    ## ###  # ### # # ## # # ### #    ",
    };
    const int L = 3;  // why do you want to read those from stdin?
    const int H = 5;  // they depend on how you define your alphabet
    const int not_a_letter = 26; // "index" of ? in your alphabet
    const int space = 27;           // I added a space
//    char T[BUFSIZE];
//    fgets(T, BUFSIZE, stdin);
    char T[]= "Hello World!"; //better starting with something short. note what happens to the '!'
    for( int i = 0; i < H; i++) { // for every row
        char  * pch = T;
        int temp;
        while( *pch != '\0') {
            if( *pch >='A' && *pch <= 'Z' ) temp = *pch - 'A';
            else if ( *pch >='a' && *pch <= 'z') temp = *pch - 'a'; // I'll print only capitals...
            else if ( *pch == ' ') temp = space;
            else temp = not_a_letter;
            int index = temp * L; 
            printf("%.*s " , L, ROW[i]+index); // print L char of string ROW[i] starting from index
            pch++;
        }
        printf("\n");
    }

    return 0;
}

Will print this:
# # ### #   #    #      # #  #  ##  #   ##  ###
# # #   #   #   # #     # # # # # # #   # #   #
### ##  #   #   # #     ### # # ##  #   # #  ##
# # #   #   #   # #     ### # # # # #   # #
# # ### ### ###  #      # #  #  # # ### ##   #

edit:
I'd like to add some considerations. Your program's input is read from stdin. This is a requirement, I guess, as most on line compiler redirect input and output from files, but it's not really convenient to enter every time all the variables, expecially all those "## ####   ###...", so I hard coded them in the program. I didn't add extra spaces between the letters so my L is 3, but in the picturre you posted they did, so your L is 4.
You can keep that part of your program unchanged (mostly), but I'd like to point out a couple of things. When you read T you allocate enough space for 256 char, usually consolle screen are ~80 column wide so a string greater then 20 characters ( 80/4 ;) will be messed up when printed on stdout unless the output is redirected to a file (probably) or you change the program so that it can print out from T only 20 char at a time.
Then you read the "font" using a buffer (ROW) big enough to contain 256 magnified characters (256*4=1024 ;) which is the entire ASCII set. I used only the capital letters, of course, but the problem is that IF they give you ALL the character you don't need a temp variable to shift the index to the right range, otherwise you don't need all that space. You should check what's the case.
You can read directly into ROW after having allocated the memory:
#define BUFSIZE 1025

char **ROW = malloc(H*sizeof(char*));
for (int i = 0; i < H; i++) {

    ROW[i] = malloc(BUFSIZE);
    fgets(ROW[i], BUFSIZE, stdin);

}

Remember to free the memory before closing the program:
for (int i = 0; i < H; i++) {
    free(ROW[i]);
}
free(ROW);

