Many, many issues.
First of all,
#define enum app {A,D,H};
doesn't create an enumerated type; instead, it creates a macro named enum that will be replaced with the text app {A,D,H}; whenever it appears in your code. If you want to create an enumerated type, just write
enum app {A, D, H};
Second of all, an enumerated type does not act like an array; you don't access enumeration values using array subscript syntax such as app[0]. You use the enumeration constant A, D, or H. Also, the header file does not create a namespace; you don't use State as a prefix for anything.
Finally, the enumeration constant A is not the same thing as the character constant 'A', and it won't automatically have the same value. You will have to explicitly initialize the enumeration constant with the value you want, like so:
enum app { A = 'A', D = 'D', H = 'H' };
So, putting everything together, your code will look something like this:
/**
* State.h
*/
#ifndef State_H_
#define State_H_
enum app { A = 'A', D = 'D', H = 'H' };
#endif
/**
* main.c
*/
#include <stdlib.h>
#include <stdio.h>
#include "State.h"
int main( void )
{
char letters[] ={'A', 'A', 'A', 'A'}; // thanks NiBZ.
if( letters[0] == A) // no qualifier, just the bare enum constant
{
printf("the first letter is matching");
}
return 0;
}
EDIT
As NiBZ points out, there's a problem with the declaration
char letters[] ={'AAAA'};
If you want a simple array of characters, then the initializer needs to look like
char letters[] = {'A', 'A', 'A', 'A' };
If you want letters to be a string (sequence of characters terminated by a 0-valued byte), then the initializer needs to look like either
char letters[] = {'A', 'A', 'A', 'A', 0 };
or
char letters[] = "AAAA";
END EDIT
Having said all that, this code feels very confused. If the enumeration constant A has special meaning beyond simply being the value of the character constant 'A', you should use a more meaningful name for your enumeration constant. For example, if 'A' indicates the beginning of a record or something use a name like RECORD_BEGIN instead of A:
if ( letters[0] == RECORD_BEGIN )
Otherwise, just use the bare character constant:
if ( letters[0] == 'A' )
'AAAA'....#define enum ....is a really weird construct. Well, what @Olaf said.