473,382 Members | 1,512 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Compare One String With the Multile Strings with for loop

I have to complete my assignment and i have a trouble to compare one string to the multiples string..
example i have array of string like string Regno[5];
and I want to search one reg no from them for this i create an another string Which is string opt;
now i want to compare this opt with regno[5] in a if statement..plz hgelp me in this matter.
Mar 3 '19 #1
1 1331
dev7060
636 Expert 512MB
strcmp() is such a function for comparison. But it expects arguments in char* form, not in the string form. Therefore, you may need to convert your string first to char array.
Mar 3 '19 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Matt | last post by:
if (123 > 33) will return true and if ("123" > 33) will return true So my question is, if the above behaviors are the same?? If string is a number, and compare with another number, it will...
10
by: tvn007 | last post by:
#include <iostream> #include <string> int main (void){ using namespace std; string STR =("TEST"); const std::string::size_type STR_SIZE = STR.size(); int count =0; while ( count <=...
13
by: Trint Smith | last post by:
Ok, I want to let the user use the .aspx page they are on while there is a process going on from a 'while loop': while not resultint = 0 code...... Label1.Text.WriteLine(ntime) end while ...
3
by: minguskhan | last post by:
Does anyone know how to reverse a string using a loop?
2
by: kw_uh97 | last post by:
Hello everone, I am a newbie and I have a recordset that returns the values XXXXMain XXXX1 XXXX2 XXXX3 XXXX4 XXXX5 XXXX6 YYYY1
2
by: kirke | last post by:
Hi I wanna put string in query "where" part. For example, $sql="select VEHICLE FROM database WHERE MECHANIC =BRIAN "; like above, "mechanic" column is filled with strings. Then how can I
7
pureenhanoi
by: pureenhanoi | last post by:
Hi bro! Can anyone tell me, how to compare two strings like Operating System compare file names. Example: if i have two string "T*.DOC" and "TIET1.DOC". The comparision operator must return TRUE...
4
by: ndoe | last post by:
how to compare string in file i mean compare that string content digit or alphabet,and 1 question more can we count that line if first line variable = 1,if read second line variable = 2 and so on...
0
by: nbardach | last post by:
Hope this finds everyone well. Happy New Year! I'm trying to build a Loop for a set of dropdown menus I'm inserting into a form. Basically, the client has to be able to select 1 to 20 donors...
1
by: SusannaFloora | last post by:
I have to compare two XML strings.The difference present in the second string to be coloured in green.I dont want to use datasets. Is their any other way to solve this? Ex:String1 ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.