-
">
What happens when the following code is executed? #include <stdio.h> main(){ char *s; if (s == "10") { printf("string matches"); } }
In the above code the operator == is used to compare the value of string. But this is not allowed. This is because in C program string is represented as array of characters. So the operate like comparison, assignment and so on cannot be used to manipulate array as whole. So the above code does not work. In order to achieve the string comparison instead of using == C programmers must use function named...