answersLogoWhite

0

char one [] = "A string" ;
char two [] = "Different String" ;

if (strcmp (one, two) == 0)
{
puts ("The two strings are identical") ;
}
else
{
puts ("The two strings are different") ;
}

User Avatar

Wiki User

15y ago

What else can I help you with?

Continue Learning about Basic Math

How do you write the factor strings using exponents for 8x8x8x8x8?

8 = 23 85 = 215


How can you check if a variable is a string or an integer in PHP?

Integers - The "is_int()" function can be used to check if a variable is has an integer for its value. ---- is_int($variable); // Returns true if $variable is an integer - otherwise false ---- Numeric Strings - Numeric strings are strings with numbers (or things that count as numbers) in them. Numeric-string variables are not integer variables. Numeric-string variables are passed on through forms, instead of integer variables - if you were wondering. Check form values using string formats, and not integer formats. The "is_numeric()" function can be used to check if a variable is a string with numbers - and only numbers - in it (except things that add up to be numbers). ---- is_numeric($variable); // Returns true if $variable is a string, and only contains numbers (broadly speaking) - false otherwise ---- Strings - String values are just text, basically. String variables can contain integers, but that does not make it an integer-type variable - it makes it a numeric string variable. The "is_string" function can be used to check if a variable contains the value of a string. ---- is_string($variable); // Returns true if $variable is a string - false otherwise


How do you reverse a string in PHP without using a function?

Without any function is impossible. So I'll assume you mean any coded function, in which case the predefined function below is your answer.$string = strrev($string);


How to reduce the memory leak in php?

If you are running into PHP memory leaks and frequent our of memory errors you can try moving your code into functions. PHP automatically does garbage collection after each function call. Another thing I see a lot of is not closing your database connection strings after using them as this cause build up and cause memory issues as well.


How do you compare fractions using greater or less than or equal?

the lower number for the denominator greater the number is.

Related Questions

Write a script that accepts two strings from the user and compare two strings in web technology?

how to compare two strings that take input from the user and compare it. For example: i give first string as "THE" and give second string as "HTE" then return "match" if i give first as"THE" nd second string as "EHI" then return "NOtMatch" witout using STRCMP ... please help me


Write a program to compare two strings with out using strcmp function?

#include main() { //please read two strings int str1 and str2// while(str1[i]!='/0' &&str2[i]!='/0') if(str1[i]!=str2[i]) flag=1; if(flag==1) printf("equal"); } #include main() { //please read two strings int str1 and str2// while(str1[i]!='/0' &&str2[i]!='/0') if(str1[i]!=str2[i]) flag=1; if(flag==1) printf("equal"); }


Can you tell me a C program to find if the strings are equal using pointers?

It is called strcmp, part of the standard run-time library. Returns 0 if the two strings are equals, non-zero otherwise.


When using analogies what does function mean?

The function (use) of an analogy is to compare.


How can I replace strings in a text using a specific method or function?

To replace strings in a text using a specific method or function, you can use the "replace" function in programming languages like Python or JavaScript. This function allows you to specify the string you want to replace and the new string you want to replace it with.


Is it possibly to return an array of strings in a function without using pointers in C plus plus?

No.


How do you compare 2 numbers without using relational operators in c?

using max function


How would you write a user defined function to compare two strings without using the library function?

/* ellipses, ..., used to emulate indentation */ int strcmp (const char* s1, const char* s2) { ... while (s1 != NULL && s2 != NULL) { /* scan both strings */ ... ... if (*s1 < *s2) return -1; /* first string less */ ... ... if (*s1 > *s2) return 1; /* first string greater */ ... ... s1++; ... ... s2++; ... } ... if (s1 == s2) return 0; /* strings equal or both empty */ ... if (s1 != NULL) return 1 else return -1; /* first string longer(1) / shorter(-1) */ } A slightly less computation-intensive version is: int strcmp(const char* s1, const char* s2) { ... if (s1==s2) ... ... return 0; ... while (*s1) ... ... if (*s1++^*s2++) ... ... ... if (--s1<--s2) ... ... ... ... return -1; ... ... ... else ... ... ... ... return 1; ... return 0; }


Is it possible to compare the return value of a function call with another value using a relational operator?

pancakes


Do the chime have as many as seventy strings and is played by using the hammers to strike the strings and can also be pluck or strum the strings yes or no?

Dulcimer


Which instrument has as many as seventy strings and is played using hammers to strike the strings or the musicians can also pluck or strum the strings?

Dulcimer


What is the Program for compare two strings using OR operator in java?

The String class includes two helpful methods: equals and compareTo.string1.equals(string2) will return true if the two strings contain the exact same charactersstring1.compareTo(string2) will return an int which describes the lexicographic relationship between the two strings. It will return a negative value if string1 is "less than" string2, a positive value if string1 is "greater than" string2, or zero if the two are equivalent strings.