Write a program to compare two strings without using the
strcmp() function
Answer Posted / shaiju . a
int str_cmp( const char *str1 , const char *str2)
{
while(*str1 != '\0')
{
if( *str1 == *str2)
{
str1++;
str2++;
}
else
break;
}
return *str1 - *str2;
}
| Is This Answer Correct ? | 64 Yes | 78 No |
Post New Answer View All Answers
The __________ attribute is used to announce variables based on definitions of columns in a table?
Is main is user defined function?
What are the different types of endless loops?
can we change the default calling convention in c if yes than how.........?
Why static variable is used in c?
Can you please explain the difference between exit() and _exit() function?
What is a newline escape sequence?
Explain how can I make sure that my program is the only one accessing a file?
What is clrscr in c?
Write a program to use switch statement.
What is line in c preprocessor?
What is the best way to comment out a section of code that contains comments?
count = 0; for (i = 1;i < = 10; i++);count = count + i; Value of count after execution of the above statements will be a) 0 b) 11 c) 55 d) array
about c language
What is wrong with this program statement? void = 10;