Explain the working of strcmp and strcat function, C/C++ Programming

Explain the working of strcmp and strcat Function?

strcmp() : This function is meant to use to compare two strings.

The strcmp() function acknowledge two strings as arguments and returns an integer value and depending upon the relative order of the two strings as follows:

1. A negative value if the first string leads the second string alphabetically.
2. A value of zero if the first string and the second string are alike (disregarding case).
3. A positive value if the second string leads the first string alphabetically.

so if strcmp( string 1, string2) returns a positive value it would indicate that string2 must be moved placing it ahead of string 1 in order to alphabetize the two strings properly.


strcat() : This function is meant to use to concatenate two strings.

Posted Date: 6/13/2013 6:31:51 AM | Location : United States







Related Discussions:- Explain the working of strcmp and strcat function, Assignment Help, Ask Question on Explain the working of strcmp and strcat function, Get Answer, Expert's Help, Explain the working of strcmp and strcat function Discussions

Write discussion on Explain the working of strcmp and strcat function
Your posts are moderated
Related Questions
Within software engineering, software is very rarely written by a single software engineer. Usually a team of engineers write a program; therefore a formal structural design approa

minimum of seven number

What if one can''t wrap the local in an artificial block?

Bubble sort C program: Write a program to define a bubble sort. void main()  {   clrscr();   int a[100],ch,n;   cout   cin>>n;   for (int i=0;i

A constructor that accepts one argument of a dissimilar type.

Differences between a pointer and a reference 1.  A reference must always point to some object where as this restriction is not imposed on a pointer. e.g. int *pi = 0;

Problem : Change to palindrome A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your ta

Write a program called Converter that does three types of metric conversions. Your program should prompt the user for the selection conversion, prompt for input data, and display t

P o i n t er s to Members: In C a pointer is created  to locate  the address of another variable  for faster access. Consider the following example. int x, *p; p =

(RationalNumber Class) A rational number is a number that can be represented as the quotient of two integers. For example, 1/3, 5/7, 7/2, and so forth are rational numbers (By 2/1