I wrote a program that should check if phrase is in file and output the result.
File:
//////////////
Eat my shorts!
Ay Carumba!
Stupid Flanders...
////////
Why my program doesn't cout?
The only time the condition on line 13 can evaluate to true is when nMAX is 0.
The increment on line 16 is to a local variable that disappears as soon as the function returns. You get a new num variable on each infocation of checkData.