Saved Bookmarks
| 1. |
stremp फंक्शन का उपयोग किये बिना दो स्ट्रिंग की तुलना (Comparison) किस प्रकार की जाती है? उदाहरण सहित बताइए। |
|
Answer» strcmp() is a built-in library function and is declared in // C program to illustrate // strcmp() function #include #include
int main() {
CHAR leftStr[] = "g f g"; char rightStr[] = "g f g";
// Using strcmp() int res = strcmp(leftStr, rightStr);
if (res==0) PRINTF("Strings are equal"); else printf("Strings are unequal");
printf("\nValue returned by strcmp() is: %d" , res); RETURN 0; |
|