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

Assignment Help:

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.


Related Discussions:- Explain the working of strcmp and strcat function

A client and a server for an instant messaging system based , Develop a cli...

Develop a client and a server for an instant messaging system based on UDP and IPv4

Two dimension array- c program, 2-D Array- C program: Define a two dim...

2-D Array- C program: Define a two dimension array using c. void convert ( int a[10][10] , int[] , int , int); void main()   {   clrscr();   int a[10][10], b[10

''c'' programme, Write a ''C'' program to accept any 3 digit integer number...

Write a ''C'' program to accept any 3 digit integer number from the keyboard and display the word equivalent representation of the given number.

Friend funtion.., Is friend function can be harmfull to make a secure progr...

Is friend function can be harmfull to make a secure program/sofware?

Define automatic storage classes - computer programming, Define Automatic s...

Define Automatic storage classes - computer programming? The Variables declared within function bodies are automatic by default and automatic variables are declared inside a fu

Calculate and display the marks and grade for each student, In this assignm...

In this assignment you are required to develop a program that allows the creation, viewing and storage of information about ITECH7603 Students. In order to complete the task you ha

Write down the class listnode, Question: (a) Write down the class 'Li...

Question: (a) Write down the class 'ListNode' to contain the following:- (i) variable data of type Object (ii) variable next of type ListNode (iii)

How can we simulate the concept of multiple inheritance, Problem: (a) U...

Problem: (a) Using a class hierarchy of your own choosing, with at least TWO subclass levels, show (i) the use of abstract and concrete forms of Java class and method in you

Illustrate the example of constructor, A Constructive Example Consider ...

A Constructive Example Consider an example , to model a user-defined data type for  strings. The object simulates a character array ( string ) using a character pointer and an

What is the role of && operator in a program code, What is the role of && o...

What is the role of && operator in a program code? - && is also referred to as AND operator. - When this operator is used, all conditions specified should be TRUE before nex

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd