Code 1
#include<stdio.h>
int main(){
const char st1[]={"Hello"};
const char st2[]={"Hello"};
if(st1==st2){
printf("True");
}
else{
printf("False");
}
return 0;
}
Code 2
int main(){
const char *st1="Hello";
const char *st2="Hello";
if(st1==st2){
printf("True");
}
else{
printf("False");
}
return 0;
}
Now in first code char array become const. In the first code I got False as optput. And in second code its true. Thank in advance