hi all!!

I am a beginner in C++ and need your help. I am trying to call a specific line from an input file and write it to the screen. can you tell me what the algorithm of it?. f. ex :

a 1 x
b 2 y
c 3 x
d 4 y

how can I get the '3 x' as output if I know the value 'c'.

thanks in advance.