Searching a string of consecutive characters in a binary bar code
The constant SIZE and its comment don't quite seem consistent.  A name such as size would correspond to an actual size of, say, a structure.  But with such a comment, it doesn't seem to be for that.  Consider renaming the constant to something more accurate.
bar should be const since it's not modified.
test seems like an ambiguous name for an integer variable.  It sounds more like a Boolean test flag, but that's not the case here.  Consider renaming it to something more accurate.
Since tempstring is only used within the while loop, it can just be initialized there.  It doesn't need to be declared before it.
You shouldn't mismatch integer types when doing comparisons:


while (count &lt; bar.length())



Since length() returns an std::size_t, which is an unsigned type, have count be of type std::size_t as well.  If you had compiler warnings up, then this should've been reported.
This may be a small nit-pick, but you can just return 1 instead of calling exit() in main().