I have following line of code.

test[k]->Auto->printPowerStatus();

This prints out following
0 ON, 1 ON, 2 ON, 3 ON, 4 ON, 5 OFF, 6 ON, 7 ON
8 ON, 9 ON, 10 OFF, 11 ON, 12 ON, 13 ON, 14 ON, 15 ON

I want to be able to search for "OFF" and if found, do something. If not, do something else. I cant figure out a way to do this. Can someone please help?

If you can capture the data instead of outputting it to screen then you can use string::find

Colezy

Unfortunately the devil's in the details, as implied by Colezy. You'll need to post the context of where that line is used, what that line does (in detail) and whether it is code you wrote or code you can modify before anybody can do more than give a shot in the dark.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.