You are comparing pointer values and not the contents of the string. If you want such intuitive comparison switch to Standard C++ string class or still want to use char *, then use strcmp(..) function for example.
use std::string (if you want to use == ) OR strcmp() function.
If you have
const char * a = "cplusplus";
const char * b = "cplusplus";
const char * d = "cplusplus";
a,b and c are not pointing to the same address. There are three strings for which the compiler has allocated memory in the static area. Hence the address is different. The compiler does not peek inside the string to see the contents of the strings ( if they are already present or not).
Well that does mean that compiler needs to save the string and compare all of them before saving the next one. Does the standard say any thing about the pointer address?