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
#queComputers are frequently used in check-writing systems, such as payroll and accounts payable applications. Many stories circulate regarding weekly pay- checks being printed (by

example of program to add two number

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 task is to convert S to palindrome

How to specify different memory sections for a variable using #Pragma?



Buddy systems : A method of handling the storage management problem is kept individual free lists for blocks of dissimilar sizes. Every list having free blocks of only one particul

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b.

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b.

3. Write a program to encrypt and decrypt strings of characters using the following ciphers: a) Caesar cipher b) Vigenere cipher c) Matrix transposition cipher Your program shoul