Computing leading set (compiler design)
You should structure your code a bit better and improve your naming conventions.

The first loop in main() apparently scans 6 strings into ip. From that I might deduce that ip is supposed to hold your input. So name it input or even inputProductions. Current IDEs support code completion so not using longer names for the sake of less typing is not a valid argument. 

You could also put that code into a separate function readInput(char **result). Later you can adjust how you read your input without changing main.

Then you have a couple of nested loops which compute some values to be stored in b and a value c. Using i and j as loop counter is accepted practice so that's ok but what are b and c supposed to represent? Give them names which express their meaning.

Also your outer loop counter i can go up to 5 and j &lt; i + 1 means j can go up to 5 as well. b is only an array with 4 elements, so the last index you are allowed to access is 3 and b[j] would be out of bounds for any j &gt; 3.

If that nested for loop is supposed to do some pre-processing then put it into a function and give it a sensible name which expresses what it is doing.

You have a variable called cnt - what exactly is it that you are counting? Name the variable accordingly.

Your functions access global variables like cnt or ip. You should pass all data those functions require as parameters. There is not need to create implicit dependencies.

Organize your code so its concerns are separated: input parsing, data processing, output. Your main function should read something like this:

int main()
{
    char input[7][7];
    char b[4];
    int count;

    if (!readInput(input))
    {
         puts("Failed to read input.");
         return -1;
    }

    count = preProcessInput(input, b);
    if (count &lt; 0)
    {
        puts("Failed to pre-process input");
        return -2;
    }

    if (!findLeadingSet(input, b, leadingSet, count))
    {
        puts("Failed to process input");
        return -3;
    }

    printLeadingSet(leadingSet);

    return 0;
}


This makes the structure immediately clear and explains what the steps are without having to read all the code and trying to understand it (apparently preProcessInput should be named as to what it is actually pre-processing).