CSE 332 STL Functors Studio

CSE 332 STL Functors Studio - CSE 332 Studio Session on C+...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CSE 332 Studio Session on C++ Standard Template Library Functors Functors unify the notion of a function and the notion of an object, so that functions can be used as objects (copied, passed around, etc.) and objects can be used as functions (invoked, their results obtained, etc.). These studio exercises are intended to introduce information and techniques for C++ Standard Template Library (STL) functors, and to give you experience using them in the Visual C++ environment. More details about functors can be found using the Visual Studio help utility and the useful web pages at http://www.cppreference.com/wiki/stl/functional/ and http://www.sgi.com/tech/stl/table_of_contents.html In this studio you will again work in small groups and as before students who are more familiar with the material are encouraged to help those for whom it is less familiar, and asking questions during the studio sessions is highly encouraged as well. Please record your answers as you work through the following exercises. When finished please post your answers to the required exercises, and to any enrichment exercises you completed, to the course message board as a reply to my posting titled “STL Functors Studio”. The enrichment exercises are an optional but good way to dig into the material a little deeper, especially if you breeze through the required ones. Please make sure as you work through these exercises that each team member has a chance to participate actively – e.g., take turns coding, looking up details, debugging, etc., and please also refer to the slides and the posted code examples as you work. PART I: REQUIRED EXERCISES 1. Find your team members in the studio area, sit down at/around and log in to one of the Windows machines, open up Visual Studio and create a new Visual C++ Win32 Console Application project. Change the signature of the main function in the source file that Visual C++ generated to match the one that was specified for the previous studios. Write down the names of the team members who are present (please catch up anyone arriving late on the work, and also add their name) as the answer to this exercise. 2. Declare a container of type
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/03/2010 for the course CSE 332S taught by Professor Smart during the Spring '08 term at Washington University in St. Louis.

Page1 / 3

CSE 332 STL Functors Studio - CSE 332 Studio Session on C+...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online