bool compare(char* s1, char* s2) { bool status = true; for (int i = 0;s2[i];i++) { if (s1[i]!=s2[i]) status = false; } return status; } then later to check the text here is an example: if (compare(text, "hello")) sendservmsg("hi");