473,396 Members | 2,070 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,396 software developers and data experts.

Difficulty in getting iterator upon using find algorithm of STL

Hello,
Mine is a project in Visual C++, in which I am using STL, and trying to use the "find" algorithm with vectors. But it's giving me the error, error C2678: binary '==' : no operator found which takes a left-hand operand of type 'xyz' (or there is no acceptable conversion), because I have a class which has a structure 'xyz' whose only member is a BYTE array. Hence a problem. Please help.
Feb 25 '16 #1
3 1385
Then, how to use the find algorithm from the boost library for a user-defined data type?
Please help.
Thanks in advance. This is urgent.
Feb 26 '16 #2
It is not a "find" algorithm, it's a template function in the STL assuming you're talking about the <algorithm> header. Additionally, if this was urgent why didn't you provide some code to help us out? There's no context that would allow us to help you with your issue. The operands don't match and that's about as much as we can tell you.
Feb 28 '16 #3
Hello AceInfinity,
Thanks for your reply. I got the answer to my above question, now my new question is as follows:
I have one more difficulty, may be a strange experience. The find function of STL is not giving the iterator position, even if the item to be searched is located in the BYTE array. Does it have anything to do with the size of the arrays as well? because one BYTE array is of 16 bytes, and the one it is to be compared with is of 33 bytes? In such a case, how can I make the find function give me the correct answer? Please help.
Thanks in advance.
Mar 8 '16 #4

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

Similar topics

0
by: Arpan | last post by:
How to decrypt a message using Asymmetric Algorithm (RSA Crypto Service provider) using .Net. I have successfully sent an encrypted message using recepient's public key but dont know how to...
5
by: cesco | last post by:
I have a set of pairs defined as follow: set< pair<UserEquipment*, double> > numberOfFreqSlotsToAdd; and I need to iterate through all the elements of the set in order accumulate the second...
10
by: Christian Chrismann | last post by:
Hi, I've a question on the STL find algorithm: My code: int main( void ) { vector< ClassA* myVector; ClassA *ptrElement1 = ...;
1
by: vermarajeev | last post by:
Hi, EveryBody This question is really interesting one. My question is related to "STL Find Algorithm" Defination Direct from book Now my questions are
10
by: vermarajeev | last post by:
Hi guys, I have problem regarding find algorithm used in STL Defination directly from book The find algorithm is an operation (function) that can be applied to many STL containers. It...
1
by: LinkedTableMan | last post by:
I'm trying to use the FIND command to search for a specific value in whatever field I focus on. I'm using MS Access 2007. The table the form is using is linked to SQLServer someplace on the...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.