There is no way to "skip" data on a pipe - you have to read it.
If it's a very large block, you will want to use a medium-sized buffer (as a compromise between overhead and memory usage), something like this:
size_t dataToRead = some_large_number;
while(dataToRead)
{
char buffer[4096];
size_t toread = min(sizeof(buffer), dataToRead);
size_t nread = fread(buffer, 1, toread, stdin);
dataToRead -= nread;
}
The size, 4096 is a rather arbitrary choice - but it's big enough not to cause a HUGE number of reads to the input, and small enough to not use crazy amounts of stack-space. It is unlikely that you will gain/loose much from changing this size.