By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,795 Members | 1,242 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,795 IT Pros & Developers. It's quick & easy.

Compare One String With the Multile Strings with for loop

P: 1
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
Share this Question
Share on Google+
1 Reply


dev7060
100+
P: 115
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

Post your reply

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