Penney Game - mapping macros to strings
Associating a set of constants with corresponding strings is difficult in C.  One approach is to define a structure, such as

struct patterns {
    const char combination[4];
    int count;
};


Here we have space for a string and an integer to count occurrences.
Creating an array of these and initializing it gives us this:

struct patterns patterns[N_PATTERNS] = {
    {"HHH", 0}, {"HHT", 0}, {"HTH", 0}, {"HTT", 0},
    {"THH", 0}, {"THT", 0}, {"TTH", 0}, {"TTT", 0},
};


Then you can loop through the strings by accessing each array member and
incrementing the counts.  The count and string are kept together so that
indexing errors cannot happen.

Also, your main is too complicated.  Just reading the string from the
command line is easier.

Putting it together, gives me this:

#include &lt;stdio.h&gt;
#include &lt;string.h&gt;
#include &lt;stdlib.h&gt;

#define N_PATTERNS 8
struct patterns {
    const char combination[4];
    int count;
};

static int increment_occurance(struct patterns *p, const char *s)
{
    for (int i = 0; i &lt; N_PATTERNS; ++i) {
        if (!memcmp(s, p[i].combination, 3)) {
            p[i].count += 1;
            return 1;
        }
    }
    return 0;
}

static void count_occurances(struct patterns *p, const char *s)
{
    const char *end = s + strlen(s) - 2;

    for (; s &lt; end; ++s) {
        increment_occurance(p, s);
    }
}

int main(int argc, char **argv)
{
    struct patterns patterns[N_PATTERNS] = {
        {"HHH", 0}, {"HHT", 0}, {"HTH", 0}, {"HTT", 0},
        {"THH", 0}, {"THT", 0}, {"TTH", 0}, {"TTT", 0},
    };
    if (argc &lt; 2) {
        fprintf(stderr, "Usage: %s string\n", argv[0]);
        return EXIT_FAILURE;
    }
    count_occurances(patterns, argv[1]);

    for (int i = 0; i &lt; N_PATTERNS; ++i) {
        printf("%s %d\n", patterns[i].combination, patterns[i].count);
    }
    return EXIT_SUCCESS;
}


EDIT: note that we can use the more efficient memcmp instead of strncmp in increment_occurance.