statement o compare two strings in c
#include <stdio.h>
#include <string.h>
int main()
{
char str1[] = "abcd", str2[] = "abCd", str3[] = "abcd";
int result;
// comparing strings str1 and str2
result = strcmp(str1, str2);
printf("strcmp(str1, str2) = %d\n", result);
// comparing strings str1 and str3
result = strcmp(str1, str3);
printf("strcmp(str1, str3) = %d\n", result);
return 0;
}
Also in C:
- fgets in c
- execvp bad address
- array addition and multiplication in c
- c check if array is empty
- visual studio code
- c float to int
- table fixed header
- c strcmp
- how to draw a graph or histogram in c language
- pointer arithmetic C
- what is conio.h
- how to remove a node from a linked list in c
- is 33 prime number
- python web crawler
- sidebar materializecss
- c program to find number of days in a month using switch case
- incompatible implicit declaration of built-in function ‘exit’
- recursion function bangla
- C bitwise integer absolute value
- c copy string
- uninstall elgg from hostgtor
- jframe mittig positionieren
- atol c.
- c vs python