Returning the length of a 'hidden' string within each of the sentences of another string
Some generals comments:

Define functions in reverse order to avoid prototypes, make local functions static, add void to empty parameter lists, use braces even when unnecessary, use spaces consistently around operators, define a single variable per line, return statements don't need brackets (you are inconsistent in this).

In function readLine

This function has many issues, some minor, such as casting malloc, using
sizeof(char) (sizeof char is 1 by definition) and the arbitrary limit on a
new line of 100 chars. In your variable name, str1, the '1' is unnecessary,
as you only use one string. And your default sentence allocation of 1 char is
silly - start with something reasonable, say 64 (arbitrary value).

More seriously, getchar returns an int not char.  This allows it to hold the value for EOF, the end-of-file marker.  Your for-loop should test for EOF.  If you fail to do this then if you input from a redirected file, the program will fail if EOF is reached without finding a \n.  A better loop would be, for example:

int ch;
while((ch = getchar()) != EOF) {
    if (ch == '\n') {
        break;
    }
    // do the necessary stuff
}


Your reallocation should compute the new capacity then use that in the realloc
call rather than computing it twice.  And your realloc call as it currently
stands leaks memory on failure - the original string str1 is not freed by
realloc on failure.

In function divideStringIntoSentences

You need to pass the size of sentences[] into the function to allow for overflow
detection.

In function getHiddenString

Parameter names of sentence and hidden might be more understandable than
str1, str2.  More seriously, I don't know what it is supposed to
do.  If it is supposed to find the hidden string in the sentence, then it
doesn't work.  Library function strstr would do the job for you.

In main

Although the functions handle malloc failures, main does not check for
str1 in the returned values.  Again str1 and str2 are badly named, as is
ptrarr.  The for-loop should define the loop variable and should loop up to
but not including j: for (int i = 0; i &lt; j; ++i).  And the printout
"Sentence # contains hidden string prefix length #" is printed even if the
sentence doesn't contain the hidden string.  This make me think that the
getHiddenString function is telling us the number of consecutive chars from
the hidden string contained in the sentence, or some such.  In that case it
still doesn't work and is badly named (eg if I give it "two twa twe" and the
hidden string "twe" it says, "Sentence 0 contains hidden string prefix length 4"