This is what i have for comparing two strings case sensitive. And i added a printf statement to test the numerical values of teh strings and the values are supposed to be the same but they are not. The plan was to use the numerical values to test, but i get different outputs.
-ikkinCode:#include <stdio.h> #include <conio.h> main() { int loop=0, strone, strtwo; char str[80]={"cprog"}; char str2[80]={"cprog"}; strone=str; strtwo=str2; printf("%d", strone); printf("\n%d", strtwo); /*this tests whether the two are same or not*/ /* if(strone==strtwo) { printf("The strings are equal"); } else printf("The strings are not equal"); */ getch(); } /*OUTPUT 1244964 1244884 */



LinkBack URL
About LinkBacks



.
. 