set_intersection

G

Giulio Veronesi

Hi,

set<int> s1, s2, s3;
....
set_intersection(s1.begin(), s1.end(), s2.begin(), s2.end(), ???);

What do I put at place of ??? to get in s3 the intersection between s1
and s2?

Thanks in advance,
Giulio
 
K

Kai-Uwe Bux

Giulio said:
Hi,

set<int> s1, s2, s3;
...
set_intersection(s1.begin(), s1.end(), s2.begin(), s2.end(), ???);

What do I put at place of ??? to get in s3 the intersection between s1
and s2?

Thanks in advance,
Giulio

For instance: std::inserter( s3, s3.begin() )


Best

Kai-Uwe Bux
 
G

Giulio Veronesi

You are very smart... but that page does not answer to my question.
Anyway, somebody else gave me the solution yet.

Thanks
Giulio
 
K

Karl Heinz Buchegger

Giulio said:
You are very smart... but that page does not answer to my question.
Anyway, somebody else gave me the solution yet.

The point is:
You have the worlds knowledge at your fingertips in the form of Web-sites.
There is even a search engine that can provide you with possible answers to your
questions and is very good in doing so. Especially if it comes to code examples
on how to use some features in C++. You just need to use it. Try it, it works
faster then typing a question in your newsreader and sending it to a group.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,965
Messages
2,570,148
Members
46,710
Latest member
FredricRen

Latest Threads

Top