hi there..
your pascal lines would translate to something like:
while(!feof(stdin)){c = fgetc(stdin);}
while((c=fgetc(stdin)) != '\n'){}
but most of the time there are more elegant (and faster) ways to read input.
just a few startpoints for your search:
stdin, scanf, fgets, fread, fgetc, feof
HTH