I am learning about strings in C. And got puzzled with string comparison behavior.
I have declared 3 strings as below.
char *str1="String1"; char *str2="String1"; char str3 = "String1";
comparing str1==str2 giving true where as str1==str3 giving false.
Can anybody help me, why is it so?
Complete runnable code is here http://onlinegdb.com...fork/B1mPNLqbZ
Thanks in advance.