473,395 Members | 1,941 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,395 software developers and data experts.

set_intersection

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

Sep 20 '05 #1
4 1704
Giulio Veronesi wrote:
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
Sep 20 '05 #2
Giulio Veronesi wrote:

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?


http://cplus.about.com/library/weekly/aa122403c.htm

Found in 10 seconds using http://www.google.com
search phrase: "set_intersection C++"
--
Karl Heinz Buchegger
kb******@gascad.at
Sep 20 '05 #3
You are very smart... but that page does not answer to my question.
Anyway, somebody else gave me the solution yet.

Thanks
Giulio

Sep 20 '05 #4
Giulio Veronesi wrote:

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.

--
Karl Heinz Buchegger
kb******@gascad.at
Sep 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Ryan R. Rosario | last post by:
Hello - I am working on a scheduling application that has many "rules" for scheduling people. I throw each person into the set that corresponds to 2 teams. Then I split this large group (of...
34
by: pembed2003 | last post by:
Hi All, Does C++/STL have hashtable where I can do stuff like: Hashtable h<int>; h.store("one",1); h.store("two",2); and then later retrieve them like:
7
by: Davy | last post by:
Hi all, I want to use set_intersection, and the compiler passed with a warning. But the program hang on when it enter set_intersection(), why? And how can I insert element to set by insert();...
2
by: harris.pc | last post by:
Hi, Can someone please explain to me WHY the standard does not allow the input range and the output range to overlap for set_intersection? I can't see why I can't do this (note sorted vectors,...
3
by: Generic Usenet Account | last post by:
Hi, I have some questions regarding STL set intersection. As per the STL reference manual (http://www.hpl.hp.com/techreports/95/HPL-95-11.pdf), the signatures of the set_intersection...
1
by: tutufan | last post by:
Hi, I've been trying to create a set of abstract set operations, so that I could do something like this set1 = union(set2, set3); or even set1 = set2 | set3;
4
by: Yuri CHUANG | last post by:
This is a example from a textbook,but there are some strange error that I don't understand.Could anyone give me some help to realize the operations on set.Thank you very much:-) (I compile it with...
13
by: Moohoo | last post by:
I have two sorted containers, and I wish to know if any items from one container exist in the second container. Is there anything in the standard library to do this? Thanks
1
by: PengYu.UT | last post by:
Hi, I have the following definition for a closed-open interval (see http://mathworld.wolfram.com/Interval.html). I have two sets of intervals, say A and B. Any two intervals in A (or B) have no...
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: 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
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: 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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.