Compare equality of char[] in C
char charTime[] = “TIME”; char buf[] = “SOMETHINGELSE”; C++ and C (remove std:: for C): bool equal = (std::strcmp(charTime, buf) == 0); But the true C++ way: std::string charTime = “TIME”, buf = “SOMETHINGELSE”; bool equal = (charTime == buf); Using == does not work because it tries to compare the addresses of the first … Read more