C program to compare two strings using pointers
Learn: How to compare two strings using pointers in C programming language?
Here, you will learn how to read and compare two strings using pointers in C programming language? In this program, we are taking two strings with maximum number of characters (100) MAX using pointers and comparing the strings character by characters.
Program to compare two strings using pointers in C
Output
Here, flag is a variable that is assigned by 1 initially, within the loop if any character of first string is not equal to character of second string, and then value of flag will be 0 (loop will be terminated). At the end, we will check if flag is 1, strings are same else strings are not same.
need an explanation for this answer? contact us directly to get an explanation for this answer