1

I am going through a file looking for specific words

Char[50]=getline(file,/n)

using getline to store each line into an char array to compare to the string(s) I am looking for

If( “<”x “>”==char[50]) || (“<” y “<”==char[50])||(“<”z“>”==char[50])
    Break;

Will using break, break me out of the loop early?

NathanOliver
  • 171,901
  • 28
  • 288
  • 402
Nameishi
  • 185
  • 1
  • 14
  • 3
    FYI [Why is “while ( !feof (file) )” always wrong?](http://stackoverflow.com/questions/5431941/why-is-while-feof-file-always-wrong) – NathanOliver Nov 06 '15 at 16:19
  • 2
    Either this isn't C++ code, or something went extremely wrong when you tried to paste code in your post. –  Nov 06 '15 at 16:26

1 Answers1

2

Yes, but the b needs to be lowercase.

break;

Will get you out.

Lawrence Aiello
  • 4,560
  • 5
  • 21
  • 35