Instructions
1Learn the syntax of strcmp in C++. The complete syntax is int strcmp (const char pointer1, const char pointer2);.
2
Notice that pointer1 and pointer2 are pointers to characters. Strcmp starts at the beginning of each string and begins comparing characters until they differ, or a null terminating character is read. If the bytes all match, strcmp returns zero. If the first non-matching byte as an unsigned char is greater for pointer1, strcmp returns a positive integer; otherwise, it returns a negative integer.
3
Understand that the C++ strcmp function is kept in the cstring library. You may need to include the string.h header file to use this function.
4
Look at the following complete program for some simple examples of how to use strcmp:
include
Observe the following output for this program:
What is my name? Jane
What is my name? john
What is my name? John
That's right!
Notice that this program continues to solicit input until the user enters "John". "john" is not a match because an upper and lower case "J" have different byte values.
Tags
PHP
Programming
C C++
ASP
Development Tools
Ajax
XML
Javascript
Python
VB
VC
perl
dephi
Ruby
sql
technology
Microsoft Access
Excel
ffice
Powerpoint
Word
Oracle
Related Posts "Technology"
-
Business Presentations…Make them Effective with right PPT Templates
7/11/2019 3:02:00 PM
You might also like on "Technology"
How To Build A Website Using WordPress In Ten Minutes
7/10/2019 8:05:00 PM
Website Creation Utilizing Search Engine Optimisation Under Consideration
7/10/2019 6:35:00 PM
Useful WordPress Website Design Tips
7/10/2019 3:19:00 PM
Barricades Involved In Mobile Application Testing
7/10/2019 1:27:00 PM
Hire PHP Developers India for Efficient PHP Web Development
7/10/2019 10:54:00 AM
Changing Your Logo Seamlessly
7/9/2019 8:22:00 PM
Are You Loan-Worthy? 5 Ways to Improve the Odds of Acceptance
7/9/2019 8:03:00 PM
Relevance Of Custom Website Design For Niche Audience
7/9/2019 7:30:00 PM
You Must Understand and Use Responsive Web Design
7/9/2019 4:51:00 PM
Web Design Development: A Dime a Dozen
7/9/2019 3:33:00 PM
A Great Way To Start Earning Money Online Is With An Affiliate Site
7/8/2019 4:43:00 PM