reading in from datafile, how to skip rest of line?

I'm new so bear with me. I have a datafile that contains a function I need to perform, then an integer or two I need to perform them one For example:

ADD 10101010 00010000
NOT 00010100 01110101
CONVERT 10110110
LSHIFT 00100100 3
JUNK 01001001
ADD 11111100 00000001

So, I'll read in ADD, read in the next 2 integers and perform my add function.

The problem I have is the datafile will contain invalid commands like JUNK. How would I read in JUNK, then skip to the next line ignoring the rest of the line?

datafile.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
Topic archived. No new replies allowed.