What Lb meant:
type1[26] == "length--------------------";//possibly garbage; editor doesn't like spaces.
So, type1 == "length", would never be the same.
Therefore you would receive no print outs because it would never pass the if_condition test.
His advice was to redesign using std::string; string has a dynamic size, so if it should not have extended garbage.
Otherwise, your alternative is to compare characters inside the character array to see if a match was found - possibly the first 6 characters and ensure consecutive order.
Have fun.
Edited: Forget what I said. LB stands correct:
warning: comparison with string literal results in unspecified behaviour [-Waddress]
type1[26] == "length--------------------";//possibly garbage; editor doesn't like spaces.
I have absolutely no idea what you mean, but it is definitely not what I meant. When you compare an array and a string literal, you compare the addresses.