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
to count number of occurances

Write a program that reads data into an array of type int. You must use an array. The numbers input are attendance numbers at a conference. Keep a running average, number of events

Problem 1. Explain Break and continue statements in C++. Explanation of Break statement Explanation of Continue statement 2. Explain concepts of constructors and

draw the flow chart to print the fibonacci series upto n th terms

Project Overview A certain financial institution (bank) wishes to promote its new business products/services by conducting road shows in rural areas. Their aim is to encourage peop

C++ Multiplayer Game Programming Project Project Description: We are seeking an experienced C++ Game Programmer to enhance clientside related aspects of MCS: Mars City Securi

Lennie McPherson, proprietor of Lennie''''s Bail Bonds, needs to calculate the amount due for setting the bail. Lennie requires something of value as collateral, and his fee is 10%

though the ascii is called 7-bit code. why do we use 8-bits to represent a character?

Aim: To implement a program to display a rectangle, circle and triangle. Code:                       class shape {             public:                         vir

how c program starts executing?